Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Pre-Processor variable for Kits?
CAD_coding last edited by
I am using 2 kits for my project - one for MinGW 32 bit while the other for MinGW 64 bit.
I have some code in a .cpp file which is used for either of them and I want to decide that using a pre-processor directive:
//64 bit code
//32 bit code
Also I want to use a similar mechanism for my .pro file.
How can I do this?
stevenceuppens last edited by
If your target is windows, you can use:
andreyc last edited by
For .pro files take a look "here":http://qt-project.org/faq/answer/how_can_i_detect_in_the_.pro_file_if_i_am_compiling_for_a_32_bit_or_a_64_bi#899
ChrisW67 last edited by
Alternatively you can do this in your Qt Create Project settings. Your project has two kits associated with it. Each kit build configuration has a qmake command line associated with it. You can add additional arguments to the qmake line to create pre-processor symbols you can use in your code. For example: