Installing LibCurl on Visual Studio 2010

自作多情 提交于 2019-12-19 04:15:17

问题


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 Studio 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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/6306045/installing-libcurl-on-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!