Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Strange LNK 2019 error in qt
Qt 6.11 is out! See what's new in the release blog

Strange LNK 2019 error in qt

Scheduled Pinned Locked Moved Solved C++ Gurus
6 Posts 3 Posters 2.2k 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.
  • S Offline
    S Offline
    Shaharyaar
    wrote on last edited by Shaharyaar
    #1

    I have checked my code thoroughly but here's a strange thing that linker is giving me error of unresolved symbol even though I have included list.h file in main() function. Can anybody help to fix this issue. I have uploaded the relevant screenshots of my code.

    ![main()] (https://imgur.com/k34Vozr)

    ![.pro file] (https://imgur.com/vIqZkua)

    ![list.h file] (https://imgur.com/YR15tKA)

    ![list.cpp] (https://imgur.com/E9k5Hwe)

    1 Reply Last reply
    0
    • mranger90M Offline
      mranger90M Offline
      mranger90
      wrote on last edited by
      #2

      Did you re-run qmake after adding the list.cpp to the .pro file ?

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

        Hi,

        To add to @mranger90, I wouldn't use list.h as, IIRC, it's a header that is already provided by the STL.

        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
        • S Offline
          S Offline
          Shaharyaar
          wrote on last edited by
          #4

          Running qmake corrected my problem thanks. Thing is I am new to Qt in fact I am completely new to using frameworks for developing GUI. So can you tell me why there's a need of to run qmake first and then build the project? Because I made the same code in visual studio and I build it without using cmake.

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

            You modified the project, re-running qmake refreshes the related generated files.

            However for that kind of edit, it should have happened automatically. What version of Qt Creator are you using ? How did you modify the .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
            • S Offline
              S Offline
              Shaharyaar
              wrote on last edited by
              #6

              I am currently using Qt 5.6.3

              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