[Solved] QT Example "Fortune server" fails to build

  • I have tried to run the Fortune Server example in QT but it fails to build. This is what I did:
    I created a QT Application project using the project wizard.
    The project is based on "QDialog"
    I copied the contents from the example into my project.

    First time I build I got a lot of warnings for "include <QNetwork>". I found out that the network related classes now are found in "include <QNetwork/QNetwork>". From what I understand the structure has changed from the time when the example is created and the current version of QT.

    I suspect that my .pro file is incorrect or that I have based my project on wrong class library somehow.

    After adding a few "includes" myself I get loads of "Issues" like this one:
    C:\Qt\Tools\QtCreator\bin\tsmc_server\tsmc_server.cpp:19: error: undefined reference to `_imp___ZN28QNetworkConfigurationManagerC1EP7QObject'

    This is my .pro file:

    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = test
    TEMPLATE = app

    SOURCES += main.cpp

    HEADERS += tsmc_server.h

    FORMS += tsmc_server.ui

    What did I do wrong

  • Hii.

    I can't see QT += network
    please add the above.

    hope it helps.

  • Problem solved!

    I added it like this:

    QT += core gui
    QT += network

    I am not sure what "QT +=network" means but I will look it up in the documents!

    Thanks IamSumit

  • Lifetime Qt Champion


    Short version, it means: "will use the Qt network module"

Log in to reply