It’s actually really simple and in fact I am posting this for people like myself who are in a bit too much of a hurry and miss the simple things. Everything you need comes with the zip file that you can download here:
http://curl.haxx.se/download.html
This article is divided into the following sections:
Once you have that do the following:
In your visual studio project go to your project properties -> Configuration properties -> C/C++ -> Code Generation. You might see something like: Multi-threaded Debug DLL (/MDd). As you can see to match up the runtimes libcurl must be built as a DLL in debug mode. You can ignore the Multi-threaded part as there is no way to build single threaded.
There is one snag, to build a debug DLL there are a few modifications that need to be made.
If you want to do a debug build it’s slightly trickier because things seem to be a bit broken. First you need to add a debug build option in the main Makefile. I added the following under vc-dll:
vc-dll-debug:
cd lib
nmake /f Makefile.$(VC) cfg=debug-dll
cd ..\src
nmake /f Makefile.$(VC) debug cfg=debug-dll
You then need to edit lib\Makefile.vc8 and change the "release dynamic library" option to:
# release and debug dynamic library
!IF "$(CFG)" == "release-dll" || "$(CFG)" == "debug-dll"
LINKLIBS = libcurl_imp.lib
LINKLIBS_DEBUG = libcurld_imp.lib
!ENDIF
To use the option just go back to your root directory and use "nmake vc-dll-debug".
Q: I get the error message: "Ordinal 55 can not be found in zlib1.dll"
A: You’re probably using a pre-built version of libcurl, roll your own using the above instructions or try and find a different binary.
Q: The procedure entry point WSAPoll could not be located in the dynamic link library WS2_32.dll.
Q: I get errors such as "error LNK2019: unresolved external symbol __imp__ldap_unbind_s referenced in function _Curl_ldap libcurl.lib " when building my project.
Q: I get errors such as "error LNK2001: unresolved external symbol __imp__curl_easy_init" when building my project.
A: Don’t bother trying to build it using the IDE, just use the Makefile from the command line as explained above.
Q: You get warnings while building such as:
cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
cl : Command line warning D9002 : ignoring unknown option '/YX'
A: Ensure you have change the "VC=vc6" line in the Makefile to "VC=vc8"
Q: Something else
A: See the Libcurl FAQ.
If you have any questions, comments etc please feel free to email me. All my details can be found here.