About. A different way of introducing source files into the pro file causes Qmake to fail to generate correct makefile file errors

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.