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. After installing Qt 5.12.8 PATH not set?
QtWS25 Last Chance

After installing Qt 5.12.8 PATH not set?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.2k Views
  • 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.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by
    #1

    After completing the install of Qt 5.12.8 on Windows, I expected that PATH would have been updated to add Qt related stuff but apparently not - is this something I need to do myself?

    Part of the reason I ask is that I have Anaconda2 installed and that ships a version of qmake (now an out of date one):

    C:\Users\amonra>where qmake.exe
    C:\ANACONDA2\Library\bin\qmake.exe

    C:\Users\amonra>qmake --version
    QMake version 2.01a
    Using Qt version 4.8.7 in C:/Anaconda2/Library/lib

    Or should I always
    use the customised command line short cuts that Qt sets up in the "Start" menu?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      No, Qt installer will not change your PATH.
      If you want, you can set it yourself.
      Actually, you can install multiple versions of Qt in the same machine.
      If it sets the PATH, then there will be conflicts.
      So, what we usually do is, if need to build from command line, we use that shortcut you mentioned.
      And when building from Qt Creator, there is no need to set PATH after the Kit configuration is completed.

      1 Reply Last reply
      1
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by
        #3

        OK that's fine. So my follow up question:

        I started a command prompt using the shortcut "Qt 5.12.8 (MSVC 2017 64-bit)" and then change to

        D:\qt-book\chap10\settingsviewer>

        I get:

        D:\qt-book\chap10\settingsviewer>qmake settingsviewer.pro
        Project ERROR: Cannot run compiler 'cl'. Output:

        ===================
        Maybe you forgot to setup the environment?

        Am I required to tailor the command file used for this command prompt to include all the stuff from:

        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

        Or what?

        Thanks
        David

        B 1 Reply Last reply
        0
        • PerdrixP Perdrix

          OK that's fine. So my follow up question:

          I started a command prompt using the shortcut "Qt 5.12.8 (MSVC 2017 64-bit)" and then change to

          D:\qt-book\chap10\settingsviewer>

          I get:

          D:\qt-book\chap10\settingsviewer>qmake settingsviewer.pro
          Project ERROR: Cannot run compiler 'cl'. Output:

          ===================
          Maybe you forgot to setup the environment?

          Am I required to tailor the command file used for this command prompt to include all the stuff from:

          "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

          Or what?

          Thanks
          David

          B Offline
          B Offline
          Bonnie
          wrote on last edited by Bonnie
          #4

          @Perdrix When you start the shortcut, I think there would be a notice:

          Setting up environment for Qt usage...
          Remember to call vcvarsall.bat to complete environment setup!
          

          Actually, for MSVC builds, what I usually do is: start the command prompt from VS shortcut, and then add Qt's bin to PATH in it.
          Or just open that project in Qt Creator.

          1 Reply Last reply
          0
          • PerdrixP Offline
            PerdrixP Offline
            Perdrix
            wrote on last edited by
            #5

            Not quite that simple though ...

            As c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build

            Isn't exactly in the path! I had to do hunting for it!

            David

            B 1 Reply Last reply
            0
            • PerdrixP Perdrix

              Not quite that simple though ...

              As c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build

              Isn't exactly in the path! I had to do hunting for it!

              David

              B Offline
              B Offline
              Bonnie
              wrote on last edited by Bonnie
              #6

              @Perdrix Yes, that's why I start from VS shortcut :)
              But if using Qt Creator, it's pretty simple.

              1 Reply Last reply
              0
              • PerdrixP Offline
                PerdrixP Offline
                Perdrix
                wrote on last edited by
                #7

                Well, I modified C:\Qt\5.12.8\msvc2017_64\bin\qtenv2.bat

                @echo off
                echo Setting up environment for Qt usage...
                set PATH=C:\Qt\5.12.8\msvc2017_64\bin;%PATH%
                cd /D C:\Qt\5.12.8\msvc2017_64
                echo Remember to call vcvarsall.bat to complete environment setup!
                @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
                

                But when I tried to build the project it all fell apart:

                Setting up environment for Qt usage...
                Remember to call vcvarsall.bat to complete environment setup!
                **********************************************************************
                ** Visual Studio 2017 Developer Command Prompt v15.9.14
                ** Copyright (c) 2017 Microsoft Corporation
                **********************************************************************
                [vcvarsall.bat] Environment initialized for: 'x64'
                
                C:\Qt\5.12.8\msvc2017_64>cd d:\qt-book\chap10
                
                C:\Qt\5.12.8\msvc2017_64>d:
                
                d:\qt-book\chap10>cd settingsviewer
                
                d:\qt-book\chap10\settingsviewer>qmake
                Info: creating stash file D:\qt-book\chap10\settingsviewer\.qmake.stash
                
                d:\qt-book\chap10\settingsviewer>make
                'make' is not recognized as an internal or external command,
                operable program or batch file.
                
                d:\qt-book\chap10\settingsviewer>nmake
                
                Microsoft (R) Program Maintenance Utility Version 14.16.27032.1
                Copyright (C) Microsoft Corporation.  All rights reserved.
                
                        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe" -f Makefile.Release
                
                Microsoft (R) Program Maintenance Utility Version 14.16.27032.1
                Copyright (C) Microsoft Corporation.  All rights reserved.
                
                        cl -BxC:\Qt\5.12.8\msvc2017_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E C:\Qt\5.12.8\msvc2017_64\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h
                        C:\Qt\5.12.8\msvc2017_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG --compiler-flavor=msvc --include D:/qt-book/chap10/settingsviewer/release/moc_predefs.h -IC:/Qt/5.12.8/msvc2017_64/mkspecs/win32-msvc -ID:/qt-book/chap10/settingsviewer -IC:/Qt/5.12.8/msvc2017_64/include -IC:/Qt/5.12.8/msvc2017_64/include/QtGui -IC:/Qt/5.12.8/msvc2017_64/include/QtANGLE -IC:/Qt/5.12.8/msvc2017_64/include/QtCore -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" settingsviewer.h -o release\moc_settingsviewer.cpp
                        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -IC:\Qt\5.12.8\msvc2017_64\include -IC:\Qt\5.12.8\msvc2017_64\include\QtGui -IC:\Qt\5.12.8\msvc2017_64\include\QtANGLE -IC:\Qt\5.12.8\msvc2017_64\include\QtCore -Irelease -I/include -IC:\Qt\5.12.8\msvc2017_64\mkspecs\win32-msvc -Forelease\ @C:\Users\amonra\AppData\Local\Temp\nm9F60.tmp
                main.cpp
                .\main.cpp(1): fatal error C1083: Cannot open include file: 'QApplication': No such file or directory
                settingsviewer.cpp
                d:\qt-book\chap10\settingsviewer\settingsviewer.h(4): fatal error C1083: Cannot open include file: 'QDialog': No such file or directory
                Generating Code...
                NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : return code '0x2'
                Stop.
                NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
                Stop.
                
                

                David

                Chris KawaC 1 Reply Last reply
                0
                • B Offline
                  B Offline
                  Bonnie
                  wrote on last edited by
                  #8

                  Well, this is a different issue from the title.
                  And I've seen this kind of problems all the time in the forum.
                  Maybe you can do some search.

                  1 Reply Last reply
                  0
                  • PerdrixP Perdrix

                    Well, I modified C:\Qt\5.12.8\msvc2017_64\bin\qtenv2.bat

                    @echo off
                    echo Setting up environment for Qt usage...
                    set PATH=C:\Qt\5.12.8\msvc2017_64\bin;%PATH%
                    cd /D C:\Qt\5.12.8\msvc2017_64
                    echo Remember to call vcvarsall.bat to complete environment setup!
                    @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
                    

                    But when I tried to build the project it all fell apart:

                    Setting up environment for Qt usage...
                    Remember to call vcvarsall.bat to complete environment setup!
                    **********************************************************************
                    ** Visual Studio 2017 Developer Command Prompt v15.9.14
                    ** Copyright (c) 2017 Microsoft Corporation
                    **********************************************************************
                    [vcvarsall.bat] Environment initialized for: 'x64'
                    
                    C:\Qt\5.12.8\msvc2017_64>cd d:\qt-book\chap10
                    
                    C:\Qt\5.12.8\msvc2017_64>d:
                    
                    d:\qt-book\chap10>cd settingsviewer
                    
                    d:\qt-book\chap10\settingsviewer>qmake
                    Info: creating stash file D:\qt-book\chap10\settingsviewer\.qmake.stash
                    
                    d:\qt-book\chap10\settingsviewer>make
                    'make' is not recognized as an internal or external command,
                    operable program or batch file.
                    
                    d:\qt-book\chap10\settingsviewer>nmake
                    
                    Microsoft (R) Program Maintenance Utility Version 14.16.27032.1
                    Copyright (C) Microsoft Corporation.  All rights reserved.
                    
                            "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe" -f Makefile.Release
                    
                    Microsoft (R) Program Maintenance Utility Version 14.16.27032.1
                    Copyright (C) Microsoft Corporation.  All rights reserved.
                    
                            cl -BxC:\Qt\5.12.8\msvc2017_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E C:\Qt\5.12.8\msvc2017_64\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h
                            C:\Qt\5.12.8\msvc2017_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG --compiler-flavor=msvc --include D:/qt-book/chap10/settingsviewer/release/moc_predefs.h -IC:/Qt/5.12.8/msvc2017_64/mkspecs/win32-msvc -ID:/qt-book/chap10/settingsviewer -IC:/Qt/5.12.8/msvc2017_64/include -IC:/Qt/5.12.8/msvc2017_64/include/QtGui -IC:/Qt/5.12.8/msvc2017_64/include/QtANGLE -IC:/Qt/5.12.8/msvc2017_64/include/QtCore -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" settingsviewer.h -o release\moc_settingsviewer.cpp
                            cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -IC:\Qt\5.12.8\msvc2017_64\include -IC:\Qt\5.12.8\msvc2017_64\include\QtGui -IC:\Qt\5.12.8\msvc2017_64\include\QtANGLE -IC:\Qt\5.12.8\msvc2017_64\include\QtCore -Irelease -I/include -IC:\Qt\5.12.8\msvc2017_64\mkspecs\win32-msvc -Forelease\ @C:\Users\amonra\AppData\Local\Temp\nm9F60.tmp
                    main.cpp
                    .\main.cpp(1): fatal error C1083: Cannot open include file: 'QApplication': No such file or directory
                    settingsviewer.cpp
                    d:\qt-book\chap10\settingsviewer\settingsviewer.h(4): fatal error C1083: Cannot open include file: 'QDialog': No such file or directory
                    Generating Code...
                    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : return code '0x2'
                    Stop.
                    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
                    Stop.
                    
                    

                    David

                    Chris KawaC Offline
                    Chris KawaC Offline
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Perdrix Looking at your compiler command line you don't have widgets module added in your .pro file like I told you in the other thread.

                    1 Reply Last reply
                    2

                    • Login

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