开发者

Installing LibCurl on Visual Studio 2010

I've been having a bit of trouble using LibCurl with Visual Studio 2010. Keep in mind I'm pretty new to C++.

I built the library according to the instructions on the libcurl website and tried to point my project to the include directory, libcurl.lib, etc but when I try to build the project I get a bunch of LNK2019 errors.

Can someone please walk me through how to tell Visual Stud开发者_Go百科io where the include files, .lib file, etc are (i.e. all the steps after building LibCurl up to using sample code in a test project)?

Thanks in advance.


error LNK2001: unresolved external symbol __imp__send@16

Hurray, we have an error message. Add ws2_32.lib to the Additional Dependencies setting. The MSDN Library lists the required import library at the bottom of the article for each API function.

Interpreting the linker error is important to diagnose these errors. Ignore the __imp__ prefix, that's linker glue. You can tell it is trying to find the definition of the send() function. That's a standard socket API function. The MSDN Library article for send() told me you need to add ws2_32.lib to the dependencies. The article is here, scroll to the bottom. This same information should also be available in the library documentation.


open the project settings dialog window first (right click >> properties)

this contains everything in regards to getting the project configured

find "Linker", then expand it and go to "Linker >> General"

under "Additional library directories" add the location of the ".lib" files

then go to "Linker>>input" and add the name of the library files you want to include

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜