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. Qt app build from command line
QtWS25 Last Chance

Qt app build from command line

Scheduled Pinned Locked Moved Solved General and Desktop
qmaknmakecmd
13 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.
  • S Offline
    S Offline
    sayan275
    wrote on 3 Sept 2021, 03:39 last edited by
    #1

    Am trying to build a qt app from cmd line, but facing the same issue after all steps of adding to env var PATH and running the qtenv2 and vcvarsall bat in admin mode.
    23ea0091-d7dd-49a5-a046-565d95435f9c-image.png

    another way and even tried with jom.exe
    630504e3-c733-4969-a1f1-a61afda6d60f-image.png

    setting up env with admin rights
    4c91c301-3d7b-4185-a15c-bd300f6ac350-image.png

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 3 Sept 2021, 05:48 last edited by
      #8

      To reiterate: you have to run vcvarsall.bat in the same session you run qmake. That means the same cmd.exe window, same execution rights (not admin!). When you close session (close window or type exit), your build environment will be forgotten. This is so by design.

      m trying to find the v15.x specific bat and exe to build.

      Exact path is printed in your 3rd screenshot.

      (Z(:^

      S 1 Reply Last reply 3 Sept 2021, 06:46
      4
      • S Offline
        S Offline
        sierdzio
        Moderators
        wrote on 3 Sept 2021, 04:45 last edited by
        #2

        Is your visual studio up to date?

        (Z(:^

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on 3 Sept 2021, 04:59 last edited by
          #3

          Please confirm you setup the command prompt in the bottom screen shot and then ran the build in the top screen shot from the same command prompt. These observations cast some doubt here:

          • The text is different colours in the bottom versus build command prompts
          • The environment setup lists version VS2017 v15.9.12. The nmake utility is reporting v14.16.27013.1. Visual Studio 2015 would be V14.x;
          S 1 Reply Last reply 3 Sept 2021, 05:17
          2
          • S Offline
            S Offline
            sayan275
            wrote on 3 Sept 2021, 05:07 last edited by
            #4

            MS Visual Studio 2017 pro version installed.
            I haven't done any update after the installation. With current version am able to build by Qt creator perfectly fine.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 3 Sept 2021, 05:14 last edited by
              #5

              As @ChrisW67 mentioned, your first 2 screenshots suggest the terminal is actually using MSVC 2015, which is too old.

              Make sure you run vcvarsall.bat from MSVS 2017 in the same terminal session where you want to compile.

              (Z(:^

              1 Reply Last reply
              2
              • C ChrisW67
                3 Sept 2021, 04:59

                Please confirm you setup the command prompt in the bottom screen shot and then ran the build in the top screen shot from the same command prompt. These observations cast some doubt here:

                • The text is different colours in the bottom versus build command prompts
                • The environment setup lists version VS2017 v15.9.12. The nmake utility is reporting v14.16.27013.1. Visual Studio 2015 would be V14.x;
                S Offline
                S Offline
                sayan275
                wrote on 3 Sept 2021, 05:17 last edited by
                #6

                @ChrisW67 yes...seems an issue, am trying to find the v15.x specific bat and exe to build.
                And am updating the VS to MSVC 15.9.38.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sayan275
                  wrote on 3 Sept 2021, 05:31 last edited by
                  #7

                  jom.exe is also not able to build as cl.exe is not able to be found.....
                  5fc66101-7a48-4953-a52c-22398d5a4351-image.png

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sierdzio
                    Moderators
                    wrote on 3 Sept 2021, 05:48 last edited by
                    #8

                    To reiterate: you have to run vcvarsall.bat in the same session you run qmake. That means the same cmd.exe window, same execution rights (not admin!). When you close session (close window or type exit), your build environment will be forgotten. This is so by design.

                    m trying to find the v15.x specific bat and exe to build.

                    Exact path is printed in your 3rd screenshot.

                    (Z(:^

                    S 1 Reply Last reply 3 Sept 2021, 06:46
                    4
                    • S sierdzio
                      3 Sept 2021, 05:48

                      To reiterate: you have to run vcvarsall.bat in the same session you run qmake. That means the same cmd.exe window, same execution rights (not admin!). When you close session (close window or type exit), your build environment will be forgotten. This is so by design.

                      m trying to find the v15.x specific bat and exe to build.

                      Exact path is printed in your 3rd screenshot.

                      S Offline
                      S Offline
                      sayan275
                      wrote on 3 Sept 2021, 06:46 last edited by
                      #9

                      @sierdzio ok I'll do an exit at end to close and to try to build.
                      Some issue vs version installed in my system. Am not find the folder with v15.9.XXX
                      C:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake,exe
                      C:\LegacyApp\Microsoft Visual Studio\VC\Auxiliary\Build\vcvarsall.bat

                      These are added in ENV var PATH.

                      another nmake I found in this location.
                      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

                      S 1 Reply Last reply 3 Sept 2021, 06:51
                      0
                      • S sayan275
                        3 Sept 2021, 06:46

                        @sierdzio ok I'll do an exit at end to close and to try to build.
                        Some issue vs version installed in my system. Am not find the folder with v15.9.XXX
                        C:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake,exe
                        C:\LegacyApp\Microsoft Visual Studio\VC\Auxiliary\Build\vcvarsall.bat

                        These are added in ENV var PATH.

                        another nmake I found in this location.
                        C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

                        S Offline
                        S Offline
                        sierdzio
                        Moderators
                        wrote on 3 Sept 2021, 06:51 last edited by
                        #10

                        @sayan275 said in Qt app build from command line:

                        @sierdzio ok I'll do an exit at end to close and to try to build.

                        ?? I've told you to do the exact opposite. Anyway, just try it out.

                        Some issue vs version installed in my system. Am not find the folder with v15.9.XXX

                        But the screenshot clearly shows VS 15.9.12 residing in: C:\LegacyApp\Microsoft Visual Studio\VC\Auxiliary\Build

                        (Z(:^

                        S 1 Reply Last reply 3 Sept 2021, 07:01
                        0
                        • S sierdzio
                          3 Sept 2021, 06:51

                          @sayan275 said in Qt app build from command line:

                          @sierdzio ok I'll do an exit at end to close and to try to build.

                          ?? I've told you to do the exact opposite. Anyway, just try it out.

                          Some issue vs version installed in my system. Am not find the folder with v15.9.XXX

                          But the screenshot clearly shows VS 15.9.12 residing in: C:\LegacyApp\Microsoft Visual Studio\VC\Auxiliary\Build

                          S Offline
                          S Offline
                          sayan275
                          wrote on 3 Sept 2021, 07:01 last edited by
                          #11

                          @sierdzio said in Qt app build from command line:

                          15.9.12 r
                          Thank you all.

                          Yes tried all in same console and it worked.
                          3b79fdfd-461d-42de-8d10-556d813f2d1b-image.png

                          But not able understand the version difference with folders and what's getting on console.

                          S 1 Reply Last reply 3 Sept 2021, 07:10
                          0
                          • S sayan275
                            3 Sept 2021, 07:01

                            @sierdzio said in Qt app build from command line:

                            15.9.12 r
                            Thank you all.

                            Yes tried all in same console and it worked.
                            3b79fdfd-461d-42de-8d10-556d813f2d1b-image.png

                            But not able understand the version difference with folders and what's getting on console.

                            S Offline
                            S Offline
                            sierdzio
                            Moderators
                            wrote on 3 Sept 2021, 07:10 last edited by
                            #12

                            @sayan275 said in Qt app build from command line:

                            Yes tried all in same console and it worked.

                            Nice!

                            But not able understand the version difference with folders and what's getting on console.

                            You mean that it sometimes loads VS 2015 and sometimes 2017? Yeah that's pretty weird. You'll need to search through your disk to find real concrete paths to both of your compilers.

                            (Z(:^

                            1 Reply Last reply
                            2
                            • C Offline
                              C Offline
                              ChrisW67
                              wrote on 3 Sept 2021, 07:53 last edited by
                              #13

                              If the VS 2015 executables are in the default system PATH then this is the result I would expect from a normal CMD shell. I expect that after running vcvarsall in that CMD shell its PATH will have the VS 2017 binary directory inserted before the VS 2015 ones.

                              1 Reply Last reply
                              1

                              5/13

                              3 Sept 2021, 05:14

                              8 unread
                              • Login

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