Hi, I am trying to link Curl into my project in visual studio 2013 (C++).
I downloaded Curl from http://curl.haxx.se/download.html
(the brinary one). I know there is development, although they are older versions.
Not sure whether it matters which one I download. Can anyone clarify?
Win32 - Generic
Win32 zip 7.38.0 binary Dirk Paehl
Win32 CAB 7.38.0 binary SSL Stefan Kanthak 422 KB
Win32 zip 7.38.0 binary SSL SSH Dirk Paehl
Win32 2000/XP zip 7.34.0 binary SSL Günter Knauf 2.02 MB
Win32 2000/XP zip 7.34.0 binary SSL SSH Günter Knauf 2.40 MB
Win32 2000/XP zip 7.34.0 libcurl SSL Günter Knauf 3.34 MB
Win32 2000/XP MSI 7.38.0 binary SSL SSH Edward LoPinto
I went for this one:
Win32 2000/XP zip 7.38.0 binary SSL SSH Edward LoPinto
www.confusedbycode.com/curl/curl-7.38.0-win32.zip
I have added the include folder into visual studio:
D:\curl-7.38.0-win32\include\
And added the library folder into visual studio:
D:\curl-7.38.0-win32\lib\
Code:
//extract of code for include
#include <curl/curl.h>
//extract of code for CURL code
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_URL, "www.myurl.com");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
//extract of code for callback function
static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *data)
{
//printf("xx");
}
I get these errors when I compile:
Error 5 error LNK2019: unresolved external symbol "public: static unsigned int __cdecl MenuScene::write_callback(void *,unsigned int,unsigned int,void *)" (?write_callback@MenuScene@@SAIPAXII0@Z) referenced in function "public: virtual bool __thiscall MenuScene::init(void)" (?init@MenuScene@@UAE_NXZ) D:\Chris\Projects\abcd\proj.win32\MenuScene.obj abcd
Error 6 error LNK1120: 1 unresolved externals D:\Chris\Projects\abcd\proj.win32\Debug.win32\abcd.exe 1 1 abcd
Anyone know what I need to do to resolve the linker errors ?