c++ - Libcurl+QtCreator+debian -


i newbie on linux, have lot of trouble it.

i want use curl in qt project (c++). created project, write in main.cpp

#include <curl/curl.h>  int main( void ){     curl *curl;      /* first step, init curl */     curl = curl_easy_init();     if (!curl) {        return -1;     }      return 0; } 

i tried compile code, have 1 error: undefined reference 'curl_easy_init()' realise, qt creator wants know path library. open test.pro file , append:

includepath += /usr/lib/x86_64-linux-gnu/  libs += /usr/lib/x86_64-linux-gnu/libcurl.a libs += /usr/lib/x86_64-linux-gnu/libcurldll.a 

and error: libcurlldll.a no such file or dirrectory. definetly haven't library, try install/reinstall types of libcurl , doesn't work.

sites, tried search information:

http://www.cplusplus.com/forum/general/89488/

http://curl.haxx.se/libcurl/using/apps.html

https://stackoverflow.com/

please, redirect me simple guide "how use libcurl in qt creator on debian" or that. need step-by-step guide. or can write me there, can use it?

sorry english, learning. thanks!

this works me fine:

main.cpp

include

int main( void ){     curl *curl;      /* first step, init curl */     curl = curl_easy_init();     if (!curl) {        return -1;     }      return 0; } 

main.pro

template = app target = curl qt -= core gui  libs += -lcurl  # config += link_pkgconfig # pkgconfig += curl  sources += main.cpp 

as can see in comment, use pkgconfig instead of libs variable neater.

make sure have corresponding packages installed necessary, instance development, etc.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -