Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]Errors while compiling

[SOLVED]Errors while compiling

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 1.8k Views 1 Watching
  • 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 Offline
    P Offline
    Paawan
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • P Offline
        P Offline
        Paawan
        wrote on last edited by
        #3

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

        Input

        SOURCES += main.cpp udpchat.cpp

        QT += network

        HEADERS += udpchat.h

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0
          • P Offline
            P Offline
            Paawan
            wrote on last edited by
            #5

            Hi,

            I am using Qt 5.

            What value should I give TARGET?

            Thanks

            1 Reply Last reply
            0
            • musimbateM Offline
              musimbateM Offline
              musimbate
              wrote on last edited by
              #6

              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
              0
              • C Offline
                C Offline
                ChrisW67
                wrote on last edited by
                #7

                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
                0
                • P Offline
                  P Offline
                  Paawan
                  wrote on last edited by
                  #8

                  @ChrisW67: Yep. It now runs.

                  Thank you very much.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved