The following actions can help you compile and debug programs efficiently:
To see the compilation output when your project gets built, click the Compile Output button on the bottom of the screen. This displays the output of the QCC compiler. While the Issues view provides a summary of any problems encountered during compilation, the Compile Output view shows more information that helps explain the cause of an error listed in Issues.
To speed up compilation, you can inform Qt Creator of the number of CPU cores on your host machine. To do this, select the Projects tab, go to the Build Settings page, and locate the Build Steps section. You can then expand the Make instruction and in the arguments field, add -jn, where n is the number of cores on the machine:
This action instructs make to use multiple threads during compilation, which can significantly reduce build times for large projects. (It won't make any difference for our small sample project but does help when building large applications.)
If you encounter compilation problems related to moc or vtables, clean your project (by selecting
), rerun qmake (by selecting ), and then rebuild your project.Qt Creator uses qmake to generate makefiles containing instructions on how to compile the project. Sometimes the makefiles become out-of-date and must be manually regenerated by doing those previous actions.