Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    3
    4
    821
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      di98mase last edited by

      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
      tsmc_server.cpp

      HEADERS += tsmc_server.h

      FORMS += tsmc_server.ui

      What did I do wrong

      1 Reply Last reply Reply Quote 0
      • IamSumit
        IamSumit last edited by

        Hii.

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

        hope it helps.

        Be Cute

        1 Reply Last reply Reply Quote 0
        • D
          di98mase last edited by

          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

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Hi,

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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post