Changing #define does not always cause recompile

  • Hi All,

    I am using Qt Creator 2.2.1 (based on Ct4.7.4 32bit)

    I have a project where I use the definition:

    @#define SIMULATION true@

    in an .h file

    Then in various .cpp files that include this .h file I have

    @#if (SIMULATION)
    .. do thing 1
    .. do thing 2

    Now when I change the value of SIMULATION to false and recompile this does not cause "thing 2" to happen. If I make some changes in the .cpp and recompile then the change takes effect.

    I also notice other issues when partial-compiling with Qt Creator (it seems to miss changes sometimes) which cause errors. And then when I do a full re-compile everything works again.

    Does anyone know about any issues / bugs with the QT "touch"/partial compile function?


  • Hi,

    the more interesting thing is, which compiler chain do you use (gcc, mingw, msvc, ...)?
    And which platform (Windows, Linux)?

    The recompilation of the files is done by the compilers.
    Did you check, what happens if you call the compiler on the command line, if that does a recompile?

  • I am using windows with mingw

    I have not tried it from the command line yet... actually I have not got a good idea how to do that at the moment as I only compile via Qt Creator :(

Log in to reply