Solved Strange LNK 2019 error in qt
-
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)
-
Did you re-run qmake after adding the list.cpp to the .pro file ?
-
Hi,
To add to @mranger90, I wouldn't use
list.h
as, IIRC, it's a header that is already provided by the STL. -
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.
-
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 ?
-
I am currently using Qt 5.6.3