问题解决了~
When building an application that uses the static libcurl library, you must
add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker will look for
dynamic import symbols. If you get linker error like "unknown symbol
__imp__curl_easy_init ..." you have linked against the wrong (static)
library. If you want to use the libcurl.dll and import lib, you don't need
any extra CFLAGS, but use one of the import libraries below
在这里:http://curl.haxx.se/docs/faq.html#Link_errors_when_building_libcur
所以我们这样来改
菜单-->project -->settings-->C++选项卡的General里面的Project Option里面加上-DCURL_STATICLIB (其实就相当于在Preprocessor definitions里面加上CURL_STATICLIB一样)
确定-->rebuild all
又出错了:
libcurl.lib(easy.obj) : error LNK2001: unresolved external symbol
libcurl.lib(telnet.obj) : error LNK2001: unresolved external symbol
libcurl.lib(easy.obj) : error LNK2001: unresolved external symbol
.....
这个一看就明白了马上加上:
#pragma comment ( lib, "ws2_32.lib" )
#pragma comment ( lib, "wldap32.lib" )
编译-->叮的一个美妙的声音想起了,哈哈,编译成功
网上找的答案,终于可行了~看来之前没设置CURL_STSTICLIB;库应该是根本没引入进来,谢谢大家。
试过dumpbin,但没看出什么来,不会用dumpbin。。。