I don't know anything about Curl, but a quick Google search with the error message (you must have done that too...) gives the impression that you need to define CURL_STATICLIB in your project
(probably in .pro: DEFINES += CURL_STATICLIB)
I don't know anything about Curl, but a quick Google search with the error message (you must have done that too...) gives the impression that you need to define CURL_STATICLIB in your project
(probably in .pro: DEFINES += CURL_STATICLIB)
Like I said, I found some information about this and i tried already add defines curl_staticlib but it didn't help. I thought then someone have problem like me and know how to resolve, but if no one know what to do with that, I have to find other solution without curl.
Thanks
have you built curl with the same compiler you're using for build your application?
Post your PRO file
A camel can go 14 days without drink,
I can't!!!
I didn't build, just download already builded from curl site for windows/mingw32. When I tried to build from source with ssl and zlib, then I get error, "can't find -lz -lssl" or something like that, even if i already installed this lib.Qt Code:
#------------------------------------------------- # # Project created by QtCreator 2011-07-16T13:56:53 # #------------------------------------------------- QT += core gui QT += network TARGET = untitled4 TEMPLATE = app SOURCES += main.cpp\ project.cpp HEADERS += project.h FORMS += project.ui INCLUDEPATH += "D:/Qt/curl-7.21.6-devel-mingw32/include" win32:LIBS += -L"D:/Qtcurl-7.21.7-ssl-sspi-zlib-static-bin-w32" -lcurl DEFINES += CURL_STATICLIBTo copy to clipboard, switch view to plain text mode
Try defining CURL_STATICLIB BEFORE INCLUDEPATH and LIBS
A camel can go 14 days without drink,
I can't!!!
I found the solution. I define CURL_STATICLIB in my header file, before included curl.h.
Thanks
I'm having the same problem since you found the solution, please help me out.
This is my code:
Qt Code:
#include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); /* if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } */ return 0; }To copy to clipboard, switch view to plain text mode
it returns the same error you were having: undefined reference to `_imp__curl_easy_init'
by the way, I didn't compile the library (if it is necessary) I just downloaded and moved the curl library (that contains the curl.h, curlbuild.h) what do I need to do to make it work ? do I need to compile if yes, where do I do that, Its been days I've been looking for, But I don't understand what to do. I see something to use the mingw32-make mingw32 in the curl library but I don't get it fully. =/ please help me out, and also that CURL_STATICLIB what do I define in it? is it something in the code like this: #define CURL_STATICLIB
By the way I'm using CodeBlocks that comes with the Mingw. I would be very glad if you could help me, step-to-step.
So, you have a libCurl example program that uses the non-Qt Curl library. You are writing it using the non-Qt Code Blocks IDE and MingW. Why ask the question in a Qt forum?I'm having the same problem since you found the solution, please help me out.
...
By the way I'm using CodeBlocks that comes with the Mingw. I would be very glad if you could help me, step-to-step.
If you downloaded the libCurl source then you will need to build it. The instructions are in the source. Have you built it?
If you have built it or downloaded a built version then either the compiler is not finding the built library, or you need to follow the preceding post, which tells you tell you exactly how to address this problem.
Did you try it before you posted?that CURL_STATICLIB what do I define in it? is it something in the code like this: #define CURL_STATICLIB
Bookmarks