Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Changing #define does not always cause recompile

Changing #define does not always cause recompile

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views
  • 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 Offline
    C Offline
    code_fodder
    wrote on last edited by
    #1

    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
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      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
      0
      • C Offline
        C Offline
        code_fodder
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved