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 pensamientos en “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. akmalayalam

    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?

    Responder
      1. akmalayalam

        Its quite interesting that sometimes the question itself will lead us to the solution. Here is the best example.
        Thanks Mr.Heitz for your relevent question!! Yes, the problem was with the downloading of wrong libsasl.dll. Eventhough I dowloaded the correct libcurl from http://curl.haxx.se/latest.cgi?curl=win32-ssl-devel-msvc, in the case of libsasl.dll, it din’t happen.!! Thanks to Mr.Heitz that I downloaded the correct dll from http://www.userbooster.de/en/download/openldap-for-windows.aspx (install the exe and take the libsasl.dll from the installed folder) and now it is working fine.!!

      2. akmalayalam

        Pleasure…!!
        Yes, I downloaded the dll from the link you said. Its also working fine. Infact there is a major size difference between the dlls. The one you prescribed is having a size of 67kb whereas the one that I used previously is having 186kb!! Smaller is beautiful..!! Thank you Mr.Heitz.

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

Deja un comentario

Por favor, inicia sesión con uno de estos métodos para publicar tu comentario:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s