2011-12-12 4 views
1

저는 C++에 초보자이고 mingw 컴파일러를 사용하고 있습니다. 컴파일Windows에서 curlpp 사용. 시작하는 방법

C:\Users\UserName\AppData\Local\Temp\ccpkmZ1C.o:test.cpp:(.text$_ZN6curlpp11Option 
TraitISsL10CURLoption10002EED1Ev[curlpp::OptionTrait<std::basic_string<char, std 
::char_traits<char>, std::allocator<char> >, (CURLoption)10002>::~OptionTrait()] 
+0xb): undefined reference to `_imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10 
002EEE' 
... 
... 

여기에 어떤 문제가있는 동안 마지막 줄

#include <curlpp/cURLpp.hpp> 
#include <curlpp/Easy.hpp> 
#include <curlpp/Options.hpp> 
.... 
string url ("http://www.google.com"); 
curlpp::Cleanup myCleanup; 
curlpp::options::Url myUrl(url); 

는 다음과 같은 긴 오류가 발생합니다? curlpp 및 libcurl에서 include 폴더를 복사하여 curlpp을 사용하기 위해 더 많은 작업을 수행해야합니까?

미리 감사드립니다.

답변

2

이것은 링커 오류입니다.

빌드 명령에 libcurl 라이브러리를 추가해야합니다. 뭔가 같은 :

g++ test.cpp -o test -llibcurlpp 

내가 libcurl에서 라이브러리의 정확한 이름을 모르겠습니다.

+1

더 나은'-lcurlpp' – Benoit

+0

mingw는 -lcurlpp를 찾을 수 없다고 말합니다. -llibcurlpp도 마찬가지입니다. 나는'g ++ test.cpp -I include -o test -lcurlpp'로 빌드하고 있습니다. – Eugeny89

+1

컬링 (curl) lib 파일은 어디에 설치되어 있습니까? "-L "을 추가하십시오. : g ++ test.cpp -I -L/path/to/curl/lib/dir -o test -lcurlpp' – hmjd

0

curlpp 배포판 (보통 .tar.gz 파일)에 필요한 모든 문서를 찾을 수 있습니다. 기본적으로 클래스/함수 정의에 대해서는 README, doc\guide.pdfinclude\curlpp\ 디렉토리를 살펴볼 수 있습니다.

이 중 하나가없는 경우 latest sources을 오늘 받았는지 확인하십시오.

희망이 있습니다.