0

With fear of being mocked due to the simplicity I venture out to ask you are question:

What do i have to download and what do i include in my project to get going with the cURL library? I have tried different things but all resulting in unresolved externals meaning i am including it wrong, i guess.

An explanation of the install process in whole would be awesome! I'm not quite sure exactly what files to use and where to put them. Im using visual studio 2012.

Can anyone shed some light on this?

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222
vocoder
  • 57
  • 1
  • 5
  • 1
    _unresolved external_ does not mean you are `#include`ing it wrong. It is a linker error and means that the linker cannot find the cURL library. You need to add the `cURL.lib` (or whatever it is called) to the list of libraries to be linked and add the directory in which it is located to the list of directories to be searched by the linker. – hmjd Jan 02 '13 at 16:07
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – R. Martinho Fernandes Jan 02 '13 at 16:17

2 Answers2

0

You need to link the library during link phase of the build. There is an option in the project properties for additional library dependencies - add the .lib file(s) that comes with curl there. Just including a file in your source is rarely enough to use a library.

Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176
  • There is no .lib file in the curl-7.28.1 release. What then? – vocoder Jan 02 '13 at 16:55
  • There are several packages available for download if you downloaded the tar.gz, you need to build curl on your own. There are other binary packages for windows that you can download below. – Ivaylo Strandjev Jan 02 '13 at 16:59
  • Can you maybe elaborate a bit on how to build curl? I know my way around c and c++ but i have never come across building something in this fashion. – vocoder Jan 03 '13 at 18:08
  • Have a look [here](http://stackoverflow.com/questions/197444/building-libcurl-with-ssl-support-on-windows) – Ivaylo Strandjev Jan 03 '13 at 21:53
0

Ok I am using visual studio (2008) for your work but I will answer to the best of my knowledge.I am assuming you have built libcurl using .sln file or are using a prebuilt set of binaries.

First of all build a solution in project wizard and get a project in it. Right click on project and select properties

In properties go the C++ general tab, add the include directories of curl. Now go to Linker general tab and put the lib directory(which contains the dlls and obj files of your build) in the additional library directories. Now go to input option and put libcurl_imp.lib or libcurldll.a(depending upon your version and compile method). These names can be different and depend upon your build, but the extensions will be of these two types. It is the linker step in which you are making a mistake.

After this compile and run.

Arunav Sanyal
  • 1,708
  • 1
  • 16
  • 36