Important: Please read the Qt Code of Conduct -

Changing qmake -query variables

  • I need to change all the variables under QT_SYSROOT as well as QT_INSTALL_CONFIGURATION to all be 32bit. I looked for documentation and found the qmake -set VARIABLE VALUE as a standard way of doing it however that just creates a new variable with that path instead of replacing the one under QT_SYSROOT. I attached a screenshot for clarification where you can see both versions of QT_INSTALL_PREFIX. Is there another way of doing this?



  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Why not use qmake from your 32bit Qt ?

  • This is coming through the VS2012 Developer Command Prompt which is 32bit and linking only these 64bit directories. It's giving me problems building in visual studio since the dependencies created for the executable file are all pointing towards 64bit QT files. Is there a way I can change this?

  • Lifetime Qt Champion

    If you want to create a 32bit application, then you first need to install a 32bit version of Qt

  • I had both the 32bit and 64bit versions installed however it was creating a lot of path/version conflicts. I simply uninstalled QT altogether and installed just the 32bit version by itself. Now the developer console picks only that version up and it seems to have fixed the issue.

  • Moderators

    To answer the original question you can use a qt.conf file in your bin directory. Anything in that file will override the qmake variables.

    I had to use that when the install prefix I used when I built Qt didn't work with the windows system I was using.

    Supposedly you are able to change the variables using qmake -set <prop> <value> but mine never seems to serialize.

    Here is the "docs": on using qt.conf.

  • Lifetime Qt Champion

    The original problem was more about using the right qmake

  • Moderators

    Yea I was answering his question on setting variables, not solving the problem, which you had already pointed out he was using the wrong install of Qt.

    I just wanted him to know for future reference how he could modify those Qt variables since he had asked.

Log in to reply