Origin
Today with qt Creator 3.4.1 open a very old project, or qt 4.5.2 ,VS2008 version of the editor; no syntax errors, but prompt "LNK2019: unresolved external symbols" when linking Public:static class Log * __cdecl log::instance (void) "([email Protected]@@[email protected]), the symbol is referenced in function _main" error.
The ability to include header files in Main.cpp, and the use of shortcut keys in Qt Creator F2 can also jump to the function definition of the class. The solution is not to be baffled.
Results
It turned out to be. The different ways in which the pro file is written. First, the link does not pass. Pro File section
In this way, we attempt to add the source file under this folder in the form of a wildcard to join the project. There is nothing wrong with it, and the QT creator can also index files in the Config folder, but this is what happens in the Qmake generation Makefile.debug.
Then I think Qt Creator find the file, Qmake can not find it, we have to change, let it find, as follows:
Then we get the Makefile.debug file we need:
I study to qmake very little, also do not know what reason, since discovered this phenomenon, remember, welcome criticism correct AH!!!
About. A different way of introducing source files into the pro file causes Qmake to fail to generate correct makefile file errors