cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems using libcurl in Qt Creator

From: d3fault <d3faultdotxbe_at_gmail.com>
Date: Fri, 06 May 2011 06:30:29 -0700

Got it to work... but not statically, as that was leading me into
dependency hell.

I downloaded the 3rd link underneath "Win32 - Generic" on
http://curl.haxx.se/download.html
This:
http://www.gknw.net/mirror/curl/win32/curl-7.21.6-ssl-sspi-zlib-static-bin-w32.zip
It's marked binary, which is why I didn't try it earlier. Figured it'd
just be the .exe...
Also you still need the one right below it marked libcurl for the curl.h
file (you could probably get this elsewhere)

After that it's just a matter of adding the following to your .pro
file... pretty standard stuff

INCLUDEPATH += "C:/curl-7.21.6-devel-mingw32/include"
win32:LIBS += -L"C:/curl-7.21.6-ssl-sspi-zlib-static-bin-w32" -lcurl
(note the differences in the paths)

Then just #include <curl/curl.h> and everything works just fine.

For anyone trying to compile statically, I did get passed the "undefined
reference to `_imp__curl_easy_init'" by adding:
DEFINES += CURL_STATICLIB
to the .pro file.
You'll then get a whole new set of undefined reference errors and this
is right around where I gave up.
win32:LIBS += -L"C:/Qt\2010.05/mingw/lib" -lws2_32
takes care of a few of them, but there's still libssh2/ldap dependencies
and a few others as well

Thanks bagder for helping me in IRC
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-06