Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
4 May 2022
Did you know that your compiler likely is parsing its way through close to 100,000 lines of code for a simple "Hello World!" in Qt? Let's give it a standing applause for its hard work.
Did you also know you easily can see what exactly is given to the compiler for each source file you ask it to compile? You can, and, in this episode, we will show you how.
We will, of course, also discuss when this is useful knowledge at all.
Links:
* ninja doesn't support .cpp.i files: https://gitlab.kitware.com/cmake/cmake/-/issues/13838
* The meaning of the flags at the end of the preprocessed files: https://stackoverflow.com/questions/5370539/what-is-the-meaning-of-lines-starting-with-a-hash-sign-and-number-like-1-a-c/5370592#5370592
0:00 Introduction
0:50 Compiler and pre-processor, and especially -E option
1:37 A really weird compile error
5:05 qmake - and manually adding -E
7:24 qmake and "-save-temps" option
8:18 CMake + make
8:52 make Foo.cpp.i
9:33 CMake + ninja
12:28 Macro expansion in Qt Creator
All QML tips and tricks videos : https://www.youtube.com/playlist?list=PL6CJYn40gN6jWHP5krsQrVGyYtKh3A3be
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Learn Modern C++
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
Learn more