libcurl.lib 를 링크하여 사용하는 경우

 

error LNK2019: __imp__curl_global_init
error LNK2019: __imp__curl_global_cleanup
error LNK2019: __imp__curl_easy_cleanup
error LNK2019: __imp__curl_easy_perform
error LNK2019: __imp__curl_easy_setopt
error LNK2019: __imp__curl_easy_init

 

위와 같은 에러 메시지를 보게 될 수 있다.

 

이는 static lib를 사용하겠다는 명시를 하지 않아서 발생하는 에러로 CURL_STATICLIB 를 전처리기에 추가하거나 curl.h include 전에 #define 으로 선언해 주면 된다. 

+ Recent posts