[Qt-interest] Re : silly library question
BOUCARD Olivier
boucard_olivier at yahoo.fr
Thu May 5 16:12:31 CEST 2011
Hi,
I think you do not have to duplicate the backslashes in your .pro variables.
And, maybe better, you can use the standard slash instead as Qt probably take care of that (not sure I'm not a Windows user).
>________________________________
>De : d3fault <d3faultdotxbe at gmail.com>
>À : qt-interest at qt.nokia.com
>Envoyé le : Jeudi 5 Mai 2011 15h25
>Objet : Re : [Qt-interest] silly library question
>
>
>I'm trying to use libcurl in my Qt application... but I'm failing miserably.
>
>I added the following to my .pro file:
>
>INCLUDEPATH += "C:\\curl-7.21.6-devel-mingw32\\include"
>LIBS += -L"C:\\curl-7.21.6-devel-mingw32\\lib" -lcurl
>
>And in my basic header file, I have the following
>
>-----------HEADER-----------
>#ifndef MAINWINDOW_H
>#define MAINWINDOW_H
>#include <QMainWindow>
>#include <curl/curl.h>
>namespace Ui {
> class MainWindow;
>}
>class MainWindow : public QMainWindow
>{
> Q_OBJECT
>public:
> explicit MainWindow(QWidget *parent = 0);
> ~MainWindow();
>private:
> Ui::MainWindow *ui;
> CURL *m_Curl;
>};
>#endif // MAINWINDOW_H
>
>and in the source file:
>-----------SOURCE-----------
>#include "mainwindow.h"
>#include "ui_mainwindow.h"
>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
>{
> ui->setupUi(this);
> m_Curl = curl_easy_init();
>}
>MainWindow::~MainWindow()
>{
> delete ui;
> curl_easy_cleanup(m_Curl);
>}
>
>
>
>...but when I try to compile, I get: "undefined reference to `_imp_curl_easy_init'"
>
>I'm using Windows 7 x64 and Qt Creator 2.0.1 / Qt 4.7.0
>The libcurl I downloaded is found on this page: http://curl.haxx.se/download.html
>Scroll all the way down and it's "Win32 - Generic" -- the bottom one that says libcurl / SSL. Here's the direct link for simplicity's sake: http://www.gknw.net/mirror/curl/win32/curl-7.21.6-devel-mingw32.zip
>
>What am I doing wrong?
>
>I realize this doesn't directly relate to Qt... but at the same time I feel like it does because I've used shared/static libraries in visual studio before and never had this problem. It's most definitely a user error though.
>
>Here's a page that mentions the error I'm getting... http://curl.haxx.se/docs/faq.html#Link_errors_when_building_libcur
>Am I using the wrong library? Doesn't Qt Creator use mingw32?
>
>inb4 "use QNetworkAccessManager" ... I don't like how it handles cookies
>
>Thanks all
>
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at qt.nokia.com
>http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110505/042a959b/attachment.html
More information about the Qt-interest-old
mailing list