Search code examples
visual-studio-2010qmake

What qmake variable to set, to disable Visual Studio 2010's warning LNK4075


Our windows builds generate hundreds of warnings of this form:

LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification

I would like to disable this warning, at least temporarily, to make it easier to spot and resolve other warnings.

I've seen Visual C++: How to disable specific linker warnings? which suggests that I should be able to set /ignore:4075, but am unsure which qmake variable should I add that to?

I've looked at the variables in the qmake Variable Reference, and there are plenty of LFLAGS-related options, and without a large amount of trial and error, I'm unsure which to use.

So, what qmake variable should I adjust, with what value, to turn off LNK4075?


Solution

  • Which of the LFLAGS you use depends on what you are building.

    • Windows Console (no GUI) App => QMAKE_LFLAGS_CONSOLE
    • Windows Console (no GUI) DLL => QMAKE_LFLAGS_CONSOLE_DLL
    • Windows GUI app => QMAKE_LFLAGS_WINDOWS
    • Windows GUI DLL => QMAKE_LFLAGS_WINDOWS_DLL

    To use them, just add the flag you need to the appropriate one.

    QMAKE_LFLAGS_xyzzy += /ignore:4075
    

    If you are really in doubt, add it to all of them.