First Qt attempts – qmake troubles

External links

qmake documentation: qmake tutorial.html
qmake variables: qmake variable reference

Generate vcproj from .pro file

Command line for generating Visual studio project file from Qt .pro file.

qmake -tp vc test.pro

Missing moc_*.cpp file

When some of moc file isn’t properly generated and getting following error:

c1xx : fatal error C1083: Cannot open source file: '.\debug\moc_xxx.cpp': No such file or directory

try following:
Select corresponding .h file (for moc_xxx.cpp select xxx.h) in a project tree and select Compile from context menu. If the file is marked as “up-to-date“, try to change something in this file and repeat a compilation. If in the output window will be “up-to-date” again, you found a problem.

Use context menu on the corresponding .h file, select properties and edit “Configuration properties |Custom build steps|General|Outputs” to any value (add some char to the end of value), confirm change by Ok button and then return value back to original (remove added char). After that, compilation on correspond file will be successfully performed.

Linux relevant tips

Leave a Reply

Your email address will not be published. Required fields are marked *