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. QMAKE_CXXFLAGS overriden ?

QMAKE_CXXFLAGS overriden ?

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 8.2k 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.
  • D Offline
    D Offline
    dracheschreck
    wrote on last edited by
    #1

    Hi!

    I'm attempting to add this flag to the compiler so that my project, doesn't spew out hundreds of "ignoring #pragma warning" messages.

    @QMAKE_CXXFLAGS += -Wno-unknown-pragmas@

    Please, refrain from telling me to fix the warnings, since they are in the OpenNI libraries which I am using and do not intend to modify.

    I noticed that qmake correctly sets this flag in my makefile, like this:

    @CXXFLAGS = -m64 -pipe -Wno-unknown-pragmas -g -Wall -W -D_REENTRANT $(DEFINES)@

    The problem is that qmake is setting some other flags AFTER my flag, and probably one of them overrides mine. (probably -Wall?)

    I tested this by just putting my flag at the end of the line:

    @CXXFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT $(DEFINES) -Wno-unknown-pragmas@

    after running make, the warnings dissapeared as desired!

    Do you know why Qt Creator / qmake / ? is setting this -Wall flag? How can I avoid that this flag is set, or how can I make it so that my flag has higher priority? (i.e, be the last flag on the line)?

    Thanks for your help

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hostel
      wrote on last edited by
      #2

      Interesting situation. I checked this link:
      http://doc.qt.nokia.com/latest/qmake-variable-reference.html
      and googled a little. This will help you:
      @
      QMAKE_CXXFLAGS_WARN_ON += -Wno-unknown-pragmas
      @

      1 Reply Last reply
      1
      • D Offline
        D Offline
        dracheschreck
        wrote on last edited by
        #3

        Perfect! Thanks!

        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