Important: Please read the Qt Code of Conduct -

[Moved] Build problem, exactly with QHttpRequestHeader

  • Hi all,
    I got some problem with QHttpRequestHeader.
    When I am trying to compile code like this:
    @#include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QtNetwork/QHttpRequestHeader>

    MainWindow::MainWindow(QWidget *parent) :
    ui(new Ui::MainWindow)
    QHttpRequestHeader *header = new QHttpRequestHeader();


    compiler returns following errors:

    @collect 2: ld returned 1 exit status@


    tmp/obj/debug_shared/mainwindow.o:D:\Qt\2010.05\qt\test-build-desktop/../test/mainwindow.cpp:27: undefined reference to `_imp___ZN18QHttpRequestHeaderC1Ev'

    collect2: ld returned 1 exit status

    mingw32-make[1]: *** [debug\test.exe] Error 1

    mingw32-make: *** [debug-all] Error 2

    I have no idea how to fix this.

    I probably posted it in wrong section. My topic should be in "installation and deployment" . Sorry for that :)

  • I moved the post to the right forum.

    You should add this to your .pro file:

    QT += network

    This adds the QtNetwork lib to your project.

  • Thanks a lot!
    Now, it's working well.

  • A bit off topic, but isn't Installation&Deployment related to Qt installations, i.e. this kind of bugs shouldn't go in the "Desktop" forum?

  • Kind-of a bordercase. It fits both forums...

Log in to reply