#defines in .config file are not global
-
I recently created a new Creator project by importing an existing project with a Makefile. I then declared a number of defines in the .config file that was generated together with the rest of the project. The problem is that when I compile my code does not recognize the define statements in the file. I am using the latest QtCreator 2.4.0 from revision b0b0842b03.
This is what I have in by .config file:
@
// ADD PREDEFINED MACROS HERE!
#define F_CPU 8000000UL
@Thanks for any help on this,
/Lars -
-
bq. From "Creator Docs":http://doc.qt.nokia.com/qtcreator-2.4/creator-project-generic.html:"
The defines are specified in the .config file. The .config file is a regular C++ file, prepended to all your source files when they are parsed.I interpret it as if the file is used for parsing in Creator's internal parser (for syntax highlighting etc.). The file is not used as an include file or as list of -D options for your sources during actual compilation.
As it is a generic project, Qt Creator does not have any clue on how to pass that information to the toolchain.
To me the file serves for this purpose: You can add defines to the compiler command line using -D options. As Creator is not able to "see" those, you can repeat them in the .config file so that Creator can act correctly on the #ifdefs etc.