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. In win compile from command line
QtWS25 Last Chance

In win compile from command line

Scheduled Pinned Locked Moved Solved General and Desktop
18 Posts 5 Posters 766 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.
  • M Offline
    M Offline
    Mihaill
    wrote on 21 Dec 2023, 08:27 last edited by
    #1

    Hi!
    I using win 10, MSCV2019, qmake. I can compile project from QtCreator.
    How compile project in command line?
    I can create Makefile

     C:/Qt/5.15.2/msvc2019_64/bin/qmake.exe C:\QtProjects\qsingleteleshell\BTeleShell-ui.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug"
    

    What need do next?
    It's return much errors:

    C:\Qt\Tools\QtCreator\bin\jom\jom.exe
    
    J 1 Reply Last reply 21 Dec 2023, 08:29
    0
    • M Mihaill
      21 Dec 2023, 08:27

      Hi!
      I using win 10, MSCV2019, qmake. I can compile project from QtCreator.
      How compile project in command line?
      I can create Makefile

       C:/Qt/5.15.2/msvc2019_64/bin/qmake.exe C:\QtProjects\qsingleteleshell\BTeleShell-ui.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug"
      

      What need do next?
      It's return much errors:

      C:\Qt\Tools\QtCreator\bin\jom\jom.exe
      
      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 21 Dec 2023, 08:29 last edited by
      #2

      @Mihaill said in In win compile from command line:

      It's return much errors:

      What errors?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bonnie
        wrote on 21 Dec 2023, 08:36 last edited by Bonnie
        #3

        Did you set enviroments for msvc and qt?

        You should:

        1. Start from VS2019 start menu "x64 Native Tools Command Prompt"
        2. In the above command prompt, run "C:\Qt\5.15.2\msvc2019_64\bin\qtenv2.bat"

        Then CD to your build folder and run qmake and nmake/jom

        M 1 Reply Last reply 21 Dec 2023, 08:54
        1
        • B Bonnie
          21 Dec 2023, 08:36

          Did you set enviroments for msvc and qt?

          You should:

          1. Start from VS2019 start menu "x64 Native Tools Command Prompt"
          2. In the above command prompt, run "C:\Qt\5.15.2\msvc2019_64\bin\qtenv2.bat"

          Then CD to your build folder and run qmake and nmake/jom

          M Offline
          M Offline
          Mihaill
          wrote on 21 Dec 2023, 08:54 last edited by
          #4

          @Bonnie said in In win compile from command line:

          You should:

          Start from VS2019 start menu "x64 Native Tools Command Prompt"
          In the above command prompt, run "C:\Qt\5.15.2\msvc2019_64\bin\qtenv2.bat"

          Then CD to your build folder and run qmake and nmake/jom

          Thanks. It's help me generate moc files. What need doing now for generate .exe?

          J 1 Reply Last reply 21 Dec 2023, 08:56
          0
          • M Mihaill
            21 Dec 2023, 08:54

            @Bonnie said in In win compile from command line:

            You should:

            Start from VS2019 start menu "x64 Native Tools Command Prompt"
            In the above command prompt, run "C:\Qt\5.15.2\msvc2019_64\bin\qtenv2.bat"

            Then CD to your build folder and run qmake and nmake/jom

            Thanks. It's help me generate moc files. What need doing now for generate .exe?

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 21 Dec 2023, 08:56 last edited by
            #5

            @Mihaill All you need to do after calling qmake is to call make or jom

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            M 1 Reply Last reply 21 Dec 2023, 09:05
            1
            • J jsulm
              21 Dec 2023, 08:56

              @Mihaill All you need to do after calling qmake is to call make or jom

              M Offline
              M Offline
              Mihaill
              wrote on 21 Dec 2023, 09:05 last edited by
              #6

              @jsulm said in In win compile from command line:

              @Mihaill All you need to do after calling qmake is to call make or jom

              I call jom after qmake, jom generate moc file, but not create .exe

              J 1 Reply Last reply 21 Dec 2023, 09:10
              0
              • M Mihaill
                21 Dec 2023, 09:05

                @jsulm said in In win compile from command line:

                @Mihaill All you need to do after calling qmake is to call make or jom

                I call jom after qmake, jom generate moc file, but not create .exe

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 21 Dec 2023, 09:10 last edited by
                #7

                @Mihaill Then the build fails I guess. Any errors?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply 21 Dec 2023, 10:29
                0
                • J jsulm
                  21 Dec 2023, 09:10

                  @Mihaill Then the build fails I guess. Any errors?

                  M Offline
                  M Offline
                  Mihaill
                  wrote on 21 Dec 2023, 10:29 last edited by
                  #8

                  @jsulm said in In win compile from command line:

                  errors

                  C:\Qt\5.15.2\msvc2019_64\lib\qtmaind.lib warning LNK4272: Library computer type "x64" conflicts with target computer type "x86"

                  Chris KawaC 1 Reply Last reply 21 Dec 2023, 10:34
                  0
                  • M Mihaill
                    21 Dec 2023, 10:29

                    @jsulm said in In win compile from command line:

                    errors

                    C:\Qt\5.15.2\msvc2019_64\lib\qtmaind.lib warning LNK4272: Library computer type "x64" conflicts with target computer type "x86"

                    Chris KawaC Online
                    Chris KawaC Online
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on 21 Dec 2023, 10:34 last edited by
                    #9

                    @Mihaill You are building a 32bit app and linking to 64bit Qt. That won't work. If you want 32bit app use 32bit Qt. If you want 64bit app build from the "x64 Native Tools Command Prompt" of Visual Studio.

                    M 1 Reply Last reply 21 Dec 2023, 10:59
                    2
                    • Chris KawaC Chris Kawa
                      21 Dec 2023, 10:34

                      @Mihaill You are building a 32bit app and linking to 64bit Qt. That won't work. If you want 32bit app use 32bit Qt. If you want 64bit app build from the "x64 Native Tools Command Prompt" of Visual Studio.

                      M Offline
                      M Offline
                      Mihaill
                      wrote on 21 Dec 2023, 10:59 last edited by
                      #10

                      @Chris-Kawa But i'm using 64bit qmake

                       C:/Qt/5.15.2/msvc2019_64/bin/qmake.exe C:\QtProjects\qsingleteleshell\BTeleShell-ui.pro
                      

                      and after only

                      C:\Qt\Tools\QtCreator\bin\jom\jom.exe
                      

                      Where is usinf 32bit?

                      Christian EhrlicherC J 2 Replies Last reply 21 Dec 2023, 11:07
                      0
                      • M Mihaill
                        21 Dec 2023, 10:59

                        @Chris-Kawa But i'm using 64bit qmake

                         C:/Qt/5.15.2/msvc2019_64/bin/qmake.exe C:\QtProjects\qsingleteleshell\BTeleShell-ui.pro
                        

                        and after only

                        C:\Qt\Tools\QtCreator\bin\jom\jom.exe
                        

                        Where is usinf 32bit?

                        Christian EhrlicherC Online
                        Christian EhrlicherC Online
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on 21 Dec 2023, 11:07 last edited by
                        #11

                        @Mihaill said in In win compile from command line:

                        Where is usinf 32bit?

                        As @Chris-Kawa already said - your compiler is a compiler to create 32bit executables - setup the correct one.

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        0
                        • M Mihaill
                          21 Dec 2023, 10:59

                          @Chris-Kawa But i'm using 64bit qmake

                           C:/Qt/5.15.2/msvc2019_64/bin/qmake.exe C:\QtProjects\qsingleteleshell\BTeleShell-ui.pro
                          

                          and after only

                          C:\Qt\Tools\QtCreator\bin\jom\jom.exe
                          

                          Where is usinf 32bit?

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 21 Dec 2023, 11:15 last edited by
                          #12

                          @Mihaill "If you want 64bit app build from the "x64 Native Tools Command Prompt" of Visual Studio."

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          M 1 Reply Last reply 21 Dec 2023, 11:20
                          0
                          • J jsulm
                            21 Dec 2023, 11:15

                            @Mihaill "If you want 64bit app build from the "x64 Native Tools Command Prompt" of Visual Studio."

                            M Offline
                            M Offline
                            Mihaill
                            wrote on 21 Dec 2023, 11:20 last edited by
                            #13

                            @jsulm I'm using 5f107401-aa1f-49d9-bdd5-80917acfa06e-image.png
                            but it's not help me

                            J 1 Reply Last reply 21 Dec 2023, 11:23
                            0
                            • M Mihaill
                              21 Dec 2023, 11:20

                              @jsulm I'm using 5f107401-aa1f-49d9-bdd5-80917acfa06e-image.png
                              but it's not help me

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 21 Dec 2023, 11:23 last edited by
                              #14

                              @Mihaill Then use what was suggested here...

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              M 1 Reply Last reply 21 Dec 2023, 11:25
                              0
                              • J jsulm
                                21 Dec 2023, 11:23

                                @Mihaill Then use what was suggested here...

                                M Offline
                                M Offline
                                Mihaill
                                wrote on 21 Dec 2023, 11:25 last edited by
                                #15

                                @jsulm said in In win compile from command line:

                                here...

                                no link

                                Chris KawaC 1 Reply Last reply 21 Dec 2023, 11:52
                                0
                                • M Mihaill
                                  21 Dec 2023, 11:25

                                  @jsulm said in In win compile from command line:

                                  here...

                                  no link

                                  Chris KawaC Online
                                  Chris KawaC Online
                                  Chris Kawa
                                  Lifetime Qt Champion
                                  wrote on 21 Dec 2023, 11:52 last edited by Chris Kawa
                                  #16

                                  @Mihaill If you want to solve your problem you're gonna have to start doing what we say. "Developer Command Prompt for VS 2022" is the wrong one for your case. It sets up a 32 bit compiler.

                                  It was already said by @Bonnie and me - to develop 64bit apps you need "x64 Native Tools Command Prompt".

                                  Open your start menu, scroll down to Visual Studio, open "x64 Native Tools Command Prompt". Not "Developer Command Prompt", not "x64_x86 Cross Tools Command Prompt". Not any other. "x64 Native Tools Command Prompt" is the one you need

                                  M 1 Reply Last reply 21 Dec 2023, 13:38
                                  3
                                  • Chris KawaC Chris Kawa
                                    21 Dec 2023, 11:52

                                    @Mihaill If you want to solve your problem you're gonna have to start doing what we say. "Developer Command Prompt for VS 2022" is the wrong one for your case. It sets up a 32 bit compiler.

                                    It was already said by @Bonnie and me - to develop 64bit apps you need "x64 Native Tools Command Prompt".

                                    Open your start menu, scroll down to Visual Studio, open "x64 Native Tools Command Prompt". Not "Developer Command Prompt", not "x64_x86 Cross Tools Command Prompt". Not any other. "x64 Native Tools Command Prompt" is the one you need

                                    M Offline
                                    M Offline
                                    Mihaill
                                    wrote on 21 Dec 2023, 13:38 last edited by
                                    #17

                                    @Chris-Kawa I try using 77a03c5a-e8d0-4a4b-9164-70a654ea56fa-image.png
                                    In project mutch subproject and now builded only unit test. How builded all subprojects?

                                    M 1 Reply Last reply 21 Dec 2023, 14:05
                                    0
                                    • M Mihaill
                                      21 Dec 2023, 13:38

                                      @Chris-Kawa I try using 77a03c5a-e8d0-4a4b-9164-70a654ea56fa-image.png
                                      In project mutch subproject and now builded only unit test. How builded all subprojects?

                                      M Offline
                                      M Offline
                                      Mihaill
                                      wrote on 21 Dec 2023, 14:05 last edited by
                                      #18

                                      x64 Native Tools Command Prompt help me. Thank all guys!

                                      1 Reply Last reply
                                      0
                                      • M Mihaill has marked this topic as solved on 21 Dec 2023, 14:05

                                      1/18

                                      21 Dec 2023, 08:27

                                      • Login

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