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. Disable MSVC compiler warnings
Qt 6.11 is out! See what's new in the release blog

Disable MSVC compiler warnings

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 5.0k Views 2 Watching
  • 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by
    #1

    I use QtCreator with MSVC 2013 and cannot eliminate this damned compiler warnings. I tested:

    QMAKE_CXXFLAGS += -wd4189
    QMAKE_CXXFLAGS_WARN_OFF += -wd4189
    QMAKE_CFLAGS_WARN_OFF += -wd4189
    QMAKE_CXXFLAGS_DEBUG+= -wd4189
    QMAKE_CFLAGS_RELEASE += -wd4189
    QMAKE_CFLAGS_DEBUG+= -wd4189
    QMAKE_CFLAGS_RELEASE += -wd4189

    Nothing helps ! Here is the line generated from qmake:

    cl -c -nologo -Zc:wchar_t -FS -wd4189 -Zi -MDd -wd4189 -GR -W3 -w34100 -w34189 -w44996 -EHsc

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi,
      you've probably already seen this posting on stackoverflow ( http://stackoverflow.com/questions/20402722/why-disable-specific-warning-not-working-in-visual-studio ) but perhaps it helps. So maybe you want to try QMAKE_CXXFLAGS_WARN_ON -= -wd4189. I think it would be a bit weird if it worked but who knows ^_^

      Andy314A 1 Reply Last reply
      1
      • ? A Former User

        Hi,
        you've probably already seen this posting on stackoverflow ( http://stackoverflow.com/questions/20402722/why-disable-specific-warning-not-working-in-visual-studio ) but perhaps it helps. So maybe you want to try QMAKE_CXXFLAGS_WARN_ON -= -wd4189. I think it would be a bit weird if it worked but who knows ^_^

        Andy314A Offline
        Andy314A Offline
        Andy314
        wrote on last edited by
        #3

        Hi @Wieland ,
        Wow :-) this is the solution.
        I think the problem was the order of the switches in the command line created from QMake. It puts the QMAKE_CXXFLAGS_WARN_ON at the end of it, so you can overwrite the previous warning settings.

        Thank you very much.

        1 Reply Last reply
        1

        • Login

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