Please nominate your Qt Champions for 2021!

QMake DEFINES variable

  • Hi,

    I've got a function call in a SDK that is not defined any more so I need to remove it. I don't really want to touch the SDK source code so I thought that I could use a macro to remove the call, this works fine:

    @#define functionToRemove(arg)

    But this implies to modify the SDK or one of the included files and as I said, I'd rather not. Is it possible to write that #define inside the .pro file? I tried many combinations with the DEFINES variable but none seems to work.

    @DEFINES += functionToRemove(arg)
    DEFINES += functionToRemove(arg)=
    DEFINES += "functionToRemove(arg)="
    DEFINES += functionToRemove(arg)=//
    DEFINES += "functionToRemove(arg)=/

    Did I miss something or is it just not possible to do that kind of things?

  • Maybe check this "post": from another forum. Write if this helps.

  • I've already seen that but it didn't work ... I think it is the parameter that is causing these problems

  • you must escape the braces, there is no need to have an equals sign, so I doubt that thats it.

  • I already tried but didn't succeed...

    @DEFINES += functionToRemove(arg)
    DEFINES += "functionToRemove(arg)"
    DEFINES += "functionToRemove(arg)"
    DEFINES += "functionToRemove(arg)"
    DEFINES += functionToRemove\(arg\)@

Log in to reply