Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Loading a macOS project on a Windows virtual machine
Forum Updated to NodeBB v4.3 + New Features

Loading a macOS project on a Windows virtual machine

Scheduled Pinned Locked Moved Solved Installation and Deployment
16 Posts 4 Posters 1.1k Views 3 Watching
  • 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
    MortyMars
    wrote on 5 May 2024, 00:23 last edited by
    #1

    Hi everyone,

    After reading what has been said on this subject, including on this forum, I understand that cross-compiling on macOS for Windows is not as easy as that to manage in Qt.

    The best solution seems to be to recompile the project in a virtual machine of the target system.

    So that's what I'm trying to do from a virtual Windows 11 hosted on my MacBook's macOS Sonoma, but unfortunately I can't manage to load my project into Qt Windows and have no idea how to import the configuration infos from my project file (.pro) into a 'cmake.txt'.

    Thanks for your help with the procedure.

    P 1 Reply Last reply 5 May 2024, 05:46
    0
    • A Offline
      A Offline
      Aronox
      wrote on 5 May 2024, 05:37 last edited by Aronox 5 May 2024, 05:38
      #2

      Hi! I am absolutely not the person to asnwer this question because I am VERY new to Qt and C++ but I can help you i think. I actually use Qt for my university project and what I do I just load the project into windows/mac by clicking the .pro file.

      If the project was created on windows, then it asks for a mac configuration and if it was made on mac then it asks for a windows configuration. I just simply configure the project and it just works. And yes on both systems i am using qmake.

      M 1 Reply Last reply 5 May 2024, 09:15
      0
      • M MortyMars
        5 May 2024, 00:23

        Hi everyone,

        After reading what has been said on this subject, including on this forum, I understand that cross-compiling on macOS for Windows is not as easy as that to manage in Qt.

        The best solution seems to be to recompile the project in a virtual machine of the target system.

        So that's what I'm trying to do from a virtual Windows 11 hosted on my MacBook's macOS Sonoma, but unfortunately I can't manage to load my project into Qt Windows and have no idea how to import the configuration infos from my project file (.pro) into a 'cmake.txt'.

        Thanks for your help with the procedure.

        P Offline
        P Offline
        Pl45m4
        wrote on 5 May 2024, 05:46 last edited by Pl45m4 5 May 2024, 05:47
        #3

        @MortyMars said in Loading a macOS project on a Windows virtual machine:

        have no idea how to import the configuration infos from my project file (.pro) into a 'cmake.txt'.

        Then you are not only switching the OS, but also the build system (Mac -> Win and QMake -> CMake).
        Even if it's not the recommended way for a new Qt project anymore, you can still use the *.pro file and import your Qt project as QMake project. You don't need to switch to CMake.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        M 1 Reply Last reply 5 May 2024, 09:23
        1
        • A Aronox
          5 May 2024, 05:37

          Hi! I am absolutely not the person to asnwer this question because I am VERY new to Qt and C++ but I can help you i think. I actually use Qt for my university project and what I do I just load the project into windows/mac by clicking the .pro file.

          If the project was created on windows, then it asks for a mac configuration and if it was made on mac then it asks for a windows configuration. I just simply configure the project and it just works. And yes on both systems i am using qmake.

          M Offline
          M Offline
          MortyMars
          wrote on 5 May 2024, 09:15 last edited by
          #4

          @Aronox
          Thanks for your help.
          I think the problem comes from my configuration...

          1 Reply Last reply
          0
          • P Pl45m4
            5 May 2024, 05:46

            @MortyMars said in Loading a macOS project on a Windows virtual machine:

            have no idea how to import the configuration infos from my project file (.pro) into a 'cmake.txt'.

            Then you are not only switching the OS, but also the build system (Mac -> Win and QMake -> CMake).
            Even if it's not the recommended way for a new Qt project anymore, you can still use the *.pro file and import your Qt project as QMake project. You don't need to switch to CMake.

            M Offline
            M Offline
            MortyMars
            wrote on 5 May 2024, 09:23 last edited by
            #5

            Hi @Pl45m4 ,

            Thanks for this lead, which indicates that my problem is a configuration problem.

            I have to admit that I'm a bit confused between my two Qt installations, the one on macOS and the one on Windows, because I can't configure the same settings for my project on one side and the other.

            When I try to open a .pro file on the Windows side I get this message :
            "No valid configuration files could be found.
            All the configuration files found in the "Y:\Qt\Procedures4XP\Procedures4XP.pro.user" directory are not suitable for the current version of Qt Creator, for example because they were written by an incompatible version of Qt Creator, or because a different configuration path was used."

            I also don't understand anything about adding "kits" and configuring them...

            A 1 Reply Last reply 5 May 2024, 12:58
            0
            • M MortyMars
              5 May 2024, 09:23

              Hi @Pl45m4 ,

              Thanks for this lead, which indicates that my problem is a configuration problem.

              I have to admit that I'm a bit confused between my two Qt installations, the one on macOS and the one on Windows, because I can't configure the same settings for my project on one side and the other.

              When I try to open a .pro file on the Windows side I get this message :
              "No valid configuration files could be found.
              All the configuration files found in the "Y:\Qt\Procedures4XP\Procedures4XP.pro.user" directory are not suitable for the current version of Qt Creator, for example because they were written by an incompatible version of Qt Creator, or because a different configuration path was used."

              I also don't understand anything about adding "kits" and configuring them...

              A Offline
              A Offline
              Aronox
              wrote on 5 May 2024, 12:58 last edited by
              #6

              @MortyMars yes that error is normal. from what little knowledge I have about Qt you see when you load the .pro file Qt creator looks for configuration file but they are different as Windows uses MinGW and Mac uses native files. I get that when ever I open up a project make in Windows on Mac and I just simply choose to configure the project.

              I also do one more thing, the files on my Windows documents folder are synced with google drive so what ever change I make and what ever new files I add are automatically streamed to my mac

              1 Reply Last reply
              1
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 5 May 2024, 13:09 last edited by
                #7

                The .pro.user file can not be shared between different systems - it does not belong to the source tree even it is created in there by QtCreator

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

                M 1 Reply Last reply 5 May 2024, 14:29
                1
                • C Christian Ehrlicher
                  5 May 2024, 13:09

                  The .pro.user file can not be shared between different systems - it does not belong to the source tree even it is created in there by QtCreator

                  M Offline
                  M Offline
                  MortyMars
                  wrote on 5 May 2024, 14:29 last edited by
                  #8

                  @Christian-Ehrlicher @Aronox

                  Thank you for these clarifications.
                  Unfortunately it doesn't tell me how to add the right kit and open my macOS project on Windows...

                  C P A 3 Replies Last reply 5 May 2024, 14:31
                  0
                  • M MortyMars
                    5 May 2024, 14:29

                    @Christian-Ehrlicher @Aronox

                    Thank you for these clarifications.
                    Unfortunately it doesn't tell me how to add the right kit and open my macOS project on Windows...

                    C Offline
                    C Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 5 May 2024, 14:31 last edited by
                    #9

                    @MortyMars said in Loading a macOS project on a Windows virtual machine:

                    my macOS project on Windows...

                    You can not compile MacOS under Windows.

                    Install Qt and QtCreator with the Qt online installer then QtCreator should automatically detect the Qt installation. When you want to use MSVC you also have to install it separately. Nothing more needed.

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

                    M 1 Reply Last reply 5 May 2024, 15:23
                    1
                    • M MortyMars
                      5 May 2024, 14:29

                      @Christian-Ehrlicher @Aronox

                      Thank you for these clarifications.
                      Unfortunately it doesn't tell me how to add the right kit and open my macOS project on Windows...

                      P Offline
                      P Offline
                      Pl45m4
                      wrote on 5 May 2024, 15:19 last edited by
                      #10

                      @MortyMars

                      If you have a working Qt installation on Mac and Windows, you can copy the project over to Windows and delete everything from the project folder except the .h, .cpp and one yourProject.pro file...
                      Everything else, files like something.pro.user or something.pro5372527362 can be deleted. You can also delete the build folder if it's included in your project dir.
                      When you project is "clean", you just open QtCreator, load the project with "Open Project..." and then configure it using your local kit which is installed.


                      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                      ~E. W. Dijkstra

                      M 1 Reply Last reply 5 May 2024, 15:45
                      1
                      • C Christian Ehrlicher
                        5 May 2024, 14:31

                        @MortyMars said in Loading a macOS project on a Windows virtual machine:

                        my macOS project on Windows...

                        You can not compile MacOS under Windows.

                        Install Qt and QtCreator with the Qt online installer then QtCreator should automatically detect the Qt installation. When you want to use MSVC you also have to install it separately. Nothing more needed.

                        M Offline
                        M Offline
                        MortyMars
                        wrote on 5 May 2024, 15:23 last edited by
                        #11

                        @Christian-Ehrlicher said in Loading a macOS project on a Windows virtual machine:

                        You can not compile MacOS under Windows.

                        I understand that this is unfortunately not possible :-(
                        I misspoke, sorry.
                        I meant that I can't open the project created on macOS, in a Qt installation on Windows.

                        1 Reply Last reply
                        0
                        • P Pl45m4
                          5 May 2024, 15:19

                          @MortyMars

                          If you have a working Qt installation on Mac and Windows, you can copy the project over to Windows and delete everything from the project folder except the .h, .cpp and one yourProject.pro file...
                          Everything else, files like something.pro.user or something.pro5372527362 can be deleted. You can also delete the build folder if it's included in your project dir.
                          When you project is "clean", you just open QtCreator, load the project with "Open Project..." and then configure it using your local kit which is installed.

                          M Offline
                          M Offline
                          MortyMars
                          wrote on 5 May 2024, 15:45 last edited by
                          #12

                          @Pl45m4, @Aronox, @Christian-Ehrlicher

                          After running the maintenance tool to consolidate my Qt installation, and deleting the 'myproject.pro.user' file, the project finally opens under Windows. That's great!
                          Thanks a lot @Pl45m4 for the help.

                          I'm just discovering my application on Windows and I can see that I'm going to have to do some work to make the interface look similar to what I have on the macOS side (in particular the alignment of the text in my QComboboxes, and the size of the QTextedit fonts).
                          But that's another subject that will no doubt open up new posts ;-)

                          Thanks again to everyone.

                          1 Reply Last reply
                          0
                          • M MortyMars has marked this topic as solved on 5 May 2024, 20:53
                          • M MortyMars
                            5 May 2024, 14:29

                            @Christian-Ehrlicher @Aronox

                            Thank you for these clarifications.
                            Unfortunately it doesn't tell me how to add the right kit and open my macOS project on Windows...

                            A Offline
                            A Offline
                            Aronox
                            wrote on 6 May 2024, 14:35 last edited by
                            #13

                            @MortyMars here's how I do it, after I click to sleect a kit, i sleect the kit with the same Qt version (you have to have the same version installed to do this). And it just works.
                            3668e791-9045-4826-848e-3bed67d72386-image.png

                            See i have two debug files? That is one was created on MacOS and one on Windows. And "post_login" is the main project folder with the .h, .prp, .cpp and any other source files i have in there.

                            0a95a0f2-7568-4089-b7e5-7d8fbed485bb-image.png

                            and google drive keeps the files synced between the two systems, no copying needed.

                            P 1 Reply Last reply 6 May 2024, 21:21
                            0
                            • M Offline
                              M Offline
                              MortyMars
                              wrote on 6 May 2024, 21:09 last edited by
                              #14

                              Thanks @Aronox

                              1 Reply Last reply
                              0
                              • A Aronox
                                6 May 2024, 14:35

                                @MortyMars here's how I do it, after I click to sleect a kit, i sleect the kit with the same Qt version (you have to have the same version installed to do this). And it just works.
                                3668e791-9045-4826-848e-3bed67d72386-image.png

                                See i have two debug files? That is one was created on MacOS and one on Windows. And "post_login" is the main project folder with the .h, .prp, .cpp and any other source files i have in there.

                                0a95a0f2-7568-4089-b7e5-7d8fbed485bb-image.png

                                and google drive keeps the files synced between the two systems, no copying needed.

                                P Offline
                                P Offline
                                Pl45m4
                                wrote on 6 May 2024, 21:21 last edited by Pl45m4 5 Jun 2024, 21:24
                                #15

                                @Aronox said in Loading a macOS project on a Windows virtual machine:

                                (you have to have the same version installed to do this)

                                No you don't ;-)
                                Unless there are major differences in your code and you use features that one version has and the other don't, the same code can be configured, for example, using a Qt 6.6 Kit on Windows and a Qt 6.7 or Qt 6.5 Kit on Mac.
                                When configuring a project that originates from Qt 6.7 with a very ancient kit that uses Qt 4.8, you might face some difficulties ;-)


                                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                                ~E. W. Dijkstra

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  MortyMars
                                  wrote on 7 May 2024, 08:56 last edited by
                                  #16

                                  Thank you @Pl45m4
                                  That's not my case, but it's good to know :-)

                                  1 Reply Last reply
                                  0

                                  1/16

                                  5 May 2024, 00:23

                                  • Login

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