Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Undefining WIN32 macro for the parser
QtWS25 Last Chance

Undefining WIN32 macro for the parser

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 3 Posters 5.0k 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.
  • O Offline
    O Offline
    orgads
    Qt Champions 2017
    wrote on last edited by
    #1

    Is there a way to make the parser undefine WIN32 when working with mingw?

    I'm cross-compiling, and I want to have the #ifdef WIN32 grayed out, and the #else white...

    I tried DEFINES -= WIN32 and QMAKE_COMPILER_DEFINES -= WIN32

    neither helped...

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      For cross-compiling you should select the appropriate toolchain and qmake mkspec, this should set the correct defines.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • O Offline
        O Offline
        orgads
        Qt Champions 2017
        wrote on last edited by
        #3

        Even if I use -spec linux-g++ it still considers WIN32 as defined

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          I suspect the WIN32 macro to be defined from the compiler toolchain, not from Qt. So you should be sure to have the correct headers for the crosscompiler target in the search path

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • O Offline
            O Offline
            orgads
            Qt Champions 2017
            wrote on last edited by
            #5

            I removed all #includes, it is still defined...

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              Hm... strange. I have no idea anymore, maybe sone Creator Troll with more insight to the internals can jump in here.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                I would recommend trying another channel than (just) this forum then though. Perhaps ask on IRC at #qt or even #qt-labs, if #qt doesn't yield anything. I don't see that many Trolls frequenting this forum (though there are some, of course).

                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