Important: Please read the Qt Code of Conduct -

Unable to setup Qt VS Tools

  • I'm trying to install Qt VS Tools for VS 2017 on a WIndows 7 Pro machine. I can't seem to get the environment set up correctly. The value for $(QTDIR) says ERROR: Qt install dir not found. The webpage " projects.html" says: The project might have an invalid Qt build specified. Earlier it says: "To change QWt version for all projects in a solution, select Change Solution's Qt Version in the context menu. ..." Where is this everlovin' context menu? I can't find anything that allows the Solution's Qt Version to be set.

  • Lifetime Qt Champion

    @MaxYaffe said in Unable to setup Qt VS Tools:

    Where is this everlovin' context menu?

    Right mouse click I guess at the solution

  • @MaxYaffe, did you create a system env variable with name QTDIR?

  • @Quawetim
    Yes, from the VS 2017 Developer Command Prompt:

    But from within VS 2017, looking at the Macros, $(QTDIR)= ERROR: Qt install dir not found.

  • @jsulm
    Good call. There is a right click menu hovering over the Solution in the Solution Explorer. And it has a selection "Change Soluton's Qt Version. I don't know why I didn't see it before. I think I jumped right to Properties.

    Clicking the Change Solution's Qt Version shows:
    QT5.12.4 for msvc2017_32 <-- highlighted
    QT5.12.4 for msvc2017_64

    Selecting $(QTDIR) now gives the correct value for $(QTDIR) in the macros.
    And ... wait for it ... switching back to the QT5...._32 selection NOW GIVES THE RIGHT VALUE.

    I think what is going on is that the solution was originally a non-Qt solution. I added a new Qt project to it but the solution-level settings weren't initialized.

    LSS - You may have to explicitly initialize the QT version in an old solution. It may look initialized but it isn't. Check the $(QTDIR) macro to be sure.


Log in to reply