Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Changing #define does not always cause recompile

    General and Desktop
    2
    3
    1089
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      code_fodder last edited by

      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
      #else
      .. do thing 2
      #endif@

      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?

      Thanks,
      fodder

      1 Reply Last reply Reply Quote 0
      • G
        giesbert last edited by

        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?

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply Reply Quote 0
        • C
          code_fodder last edited by

          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 :(

          1 Reply Last reply Reply Quote 0
          • First post
            Last post