Microsoft Visual Studio 2008을 사용하여 C++ 용 NTL 무한 정밀도 산술 라이브러리를 컴파일했습니다. 명령 프롬프트가 아닌 Visual Studio 인터페이스를 사용하여 this site에 설명했습니다 . 실제로 나는 명령 프롬프트에서 그것을하는 것이 좋겠지 만, 나는 어떻게해야할지 확신이 없었다.Windows 용 NTL C++ 라이브러리 컴파일 및 사용
아무튼 나는 라이브러리를 컴파일하고 명령 프롬프트에서 라이브러리를 사용하여 프로그램을 컴파일하려고합니다. 내가 컴파일하려고이 프로그램은, 나는 다음과 같은
c++ -I/appl/htopopt/Linux_x86_64/NTL-5.4.2/include mpqs.cpp main.cpp -o main -L/appl/htopopt/Linux_x86_64/NTL-5.4.2/lib -lntl -L/appl/htopopt/Linux_x86_64/gmp-4.2.1/lib -lgmp -lm
신경 끄시 GMP의 물건으로 컴파일 리눅스 시스템에서 테스트되었습니다, 그 윈도우에 설치 필요 없다. 이것은 NTL을 더 빠르게 실행할 수있는 선택 사항입니다. 어쨌든,이 리눅스에서 잘 작동합니다. 이제 Windows에서 나는 다음과 같은
cl /EHsc /I D:\Downloads\WinNTL-5_5_2\include mpqs.cpp main.cpp /link /LIBPATH:"D:\Documents\Visual Studio 2008\Projects\ntl\Debug"
쓰기 그러나 이것은 다음과 같은 오류가 발생합니다
mpqs.cpp
mpqs.cpp(38) : error C2039: 'find_smooth_vals' : is not a member of 'QS'
d:\desktop\qs\mpqs.h(12) : see declaration of 'QS'
mpqs.cpp(41) : error C2065: 'M' : undeclared identifier
mpqs.cpp(41) : error C2065: 'n' : undeclared identifier
mpqs.cpp(42) : error C2065: 'sieve_table' : undeclared identifier
mpqs.cpp(42) : error C2228: left of '.size' must have class/struct/union
type is ''unknown-type''
mpqs.cpp(43) : error C2065: 'sieve_table' : undeclared identifier
mpqs.cpp(44) : error C2065: 'qx_table' : undeclared identifier
mpqs.cpp(44) : error C3861: 'test_smoothness': identifier not found
mpqs.cpp(45) : error C2065: 'smooth_indices' : undeclared identifier
mpqs.cpp(45) : error C2228: left of '.push_back' must have class/struct/union
type is ''unknown-type''
main.cpp
Generating Code...
것처럼 그것은 내 mpqs.h 파일은 컴파일 과정에 포함되지 않습니다입니까? 또한 왜 벡터 형식에 대한 .push_back()에 대해 불평하는지 이해가 안되니?
도움을 많이 받으실 수 있습니다!
NTL은 오래되었지만 대신 [MPIR] (http://mpir.org/)을 사용하십시오. – bobobobo