Using LibCurl with Visual C++ 2010

I was stuck for some time with LibCurl and Visual C++ 2010 (VC10). The document Using libcurl in Visual Studio available at the Curl project’s website doesn’t help that much (notice it dates back from 2002). I searched on the internet for hints, but hadn’t find the ‘right’ solution. At the same time ** good for my ego **, I realized I hadn’t been the only one in trouble. ;-)

Below is how I got LibCurl working with VC10 (on a 32-bit machine).

First, download the latest version of LibCurl for VC10, here.

Now, create a new C++ project.

(In what follows, I assume that solutions are built in Debug mode, but it’s easy to derive the steps below  for the Release mode.)

First  go to Properties > Configuration Properties > VC++ Directories > Include directories. Here, add the curl directory to be found in the include directory of the unzipped Libcurl file (C:\ … \libcurl-7.19.3-win32-ssl-msvc\include\curl).

Now go to VC++ Directories > Library directories. Add the Debug directory containing curllib_static.lib, curllib.dll and curllib.lib (C:\Users\Édouard\Documents\Visual Studio 2010\LibCurl\lib\Debug).

Still in Configuration Properties, go to Linker > Input > Additional Dependencies. Here, you have to add the curllib.lib file (C:\  … \lib\Debug\curllib.lib). Type in up to name of the lib file.

The next step consists on adding curllib.dll, libeay32.dll, openldap.dll, and ssleay32.dll in the Debug directory of your project. There all are to be found in the root  directory of Libcurl. You also have to add libsasl.dll in this directory. Just google for it.

(Shouldn’t this have been the first step?) Now, open the curl.h file. Replace the line #include “curl/curlbuild.h” with #include “curlbuild.h” .

You’re done.

About these ads

17 thoughts on “Using LibCurl with Visual C++ 2010

  1. Pingback: Installing cURL using Visual Studio 2010 – Beginner’s Guide « The Etrain's Gaming and HCI Blog

  2. Pingback: Including cURL (LibCurl) into your Visual C++ 2012 Project – Aaron Day Web Design

  3. Pingback: Installing libCURL on VC++11 - Unresolved External Symbols Error | BlogoSfera

  4. Pingback: libcurl 기본 설정 | gumdaeng

  5. Pingback: Getting LibCurl to work with Visual Studio 2013CopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery, copyquery.com, android doubt, ios question, sql query, sqlite query, nodejsquery, dns query, up

  6. Pingback: Sending Android intents from VS 2008 | Stackforum.com

  7. Pingback: dll missing error on VS 2008CopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery, copyquery.com, android doubt, ios question, sql query, sqlite query, nodejsquery, dns query, update query, insert

  8. I got a problem with the last step, ‘ You also have to add libsasl.dll in this directory. Just google for it.’ When a libsasl.dll is downloaded and put in the debug folder of the project, it is showing error when running the application as ‘ The procedure entry point sasl_errdetail could not be located in the dynamic link library libsasl.dll. ‘ What to do? Could you please help?

  9. Pingback: dirt.IO | How to use libcurl with Visual Studio 12

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s