0
GMP를 사용하는 코드를 컴파일 할 때이 오류가 발생합니다. 이 문제를 해결할 수있는 방법이 있습니까? 임 컴파일 비주얼 스튜디오 2010 명령 프롬프트를 사용하여이 내가 사용하는 명령입니다gmp를 사용하여 컴파일 할 때 오류가 발생했습니다.
CL testing.c gmp.lib
int main(void)
{
mpz_t a,b;
mpz_init(b);
mpz_init(a);
gmp_randstate_t rstate; // the problem arises when declaring this
}
testing.c
testing.c(9) : error C2275: 'gmp_randstate_t' : illegal use of this type as an e
xpression
c:\cygwin\home\administrator\ss\gmp.h(252) : see declaration of 'gmp_ran
dstate_t'
testing.c(9) : error C2146: syntax error : missing ';' before identifier 'state'
testing.c(9) : error C2065: 'state' : undeclared identifier
testing.c(11) : error C2065: 'state' : undeclared identifier
testing.c(11) : warning C4047: 'function' : '__gmp_randstate_struct *' differs i
n levels of indirection from 'int'
testing.c(11) : warning C4024: '__gmp_randinit_default' : different types for fo
rmal and actual parameter 1
testing.c(13) : error C2065: 'state' : undeclared identifier
testing.c(13) : warning C4047: 'function' : '__gmp_randstate_struct *' differs i
n levels of indirection from 'int'
testing.c(13) : warning C4024: '__gmpz_urandomb' : different types for formal an
d actual parameter 2
testing.c(14) : error C2065: 'state' : undeclared identifier
testing.c(14) : warning C4047: 'function' : '__gmp_randstate_struct *' differs i
n levels of indirection from 'int'
testing.c(14) : warning C4024: '__gmpz_urandomb' : different types for formal an
d actual parameter 2
실제 코드를 포함해야합니다. –
cygwin에서 헤더를 사용하여 VC++로 컴파일하는 이유는 무엇입니까? –
에 소스 코드가 추가되었으므로 임시로 cygwin 폴더에 저장됩니다. 그것도 코드에 영향을 미치지 않는다하더라도 나는 cygwin 폴더에서 그것을 옮겼다. – user1758596