Qt Forum

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

    [SOLVED]Errors while compiling

    General and Desktop
    4
    8
    1304
    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.
    • P
      Paawan last edited by

      Hi All,

      I am getting many error when compiling and cannot understand what the cause:

      udpchat.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QLineEdit::QLineEdit(class QWidget *)" (_imp??0QLineEdit@@QEAA@PEAVQWidget@@@Z) referenced in function "public: __cdecl UDPChat::UDPChat(class QWidget *)" (??0UDPChat@@QEAA@PEAVQWidget@@@Z)

      udpchat.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QTextEdit::QTextEdit(class QWidget *)" (_imp??0QTextEdit@@QEAA@PEAVQWidget@@@Z) referenced in function "public: __cdecl UDPChat::UDPChat(class QWidget *)" (??0UDPChat@@QEAA@PEAVQWidget@@@Z)

      There are about 40 errors like this.

      Under each of them it states " File not found: udpchat.obj"

      I have made a class udpchat class ( a sub-class of QWidget).

      Please advice.

      I have run QMake many times.

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

        Hi,

        Can you show your project pro file ?

        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
        • P
          Paawan last edited by

          TEMPLATE = app
          TARGET =
          DEPENDPATH += .
          INCLUDEPATH += .

          Input

          SOURCES += main.cpp udpchat.cpp

          QT += network

          HEADERS += udpchat.h

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

            Are you using Qt 4 or Qt 5 ?

            Also, you should give TARGET a value

            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
            • P
              Paawan last edited by

              Hi,

              I am using Qt 5.

              What value should I give TARGET?

              Thanks

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

                Hi,
                Target is the name of your final executable . You should try this "tutorial":http://qt-project.org/doc/qt-4.8/qmake-tutorial.html

                Why join the navy if you can be a pirate?-Steve Jobs

                1 Reply Last reply Reply Quote 0
                • C
                  ChrisW67 last edited by

                  Qt5: You need to add "widgets" to the QT variable value (and rerun qmake) to have access to the QLineEdit, QtextEdit and other widgets

                  1 Reply Last reply Reply Quote 0
                  • P
                    Paawan last edited by

                    @ChrisW67: Yep. It now runs.

                    Thank you very much.

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