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. Building a Release for Windows 10 from Mac OS

Building a Release for Windows 10 from Mac OS

Scheduled Pinned Locked Moved Solved Installation and Deployment
18 Posts 4 Posters 4.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.
  • ResistorInTheDarkR Offline
    ResistorInTheDarkR Offline
    ResistorInTheDark
    wrote on last edited by ResistorInTheDark
    #1

    I've got my code ready. But the problem's with deployment.

    I built a release version that could run on my Mac and sent it to a friend to try it out. He uses Windows 7. It works.

    I sent it to another friend who uses Windows 10. The application doesn't work. The .app extension turns out into a folder on his screen (with contents similar to right-click->Show Package Contents for Mac).

    I was wondering if this compatibility issue was due to the -spec flag on the qmake? I tried setting (in Additional arguments) -spec win32-clang-g++ and a bunch of other win32 mkspecs but, when building, I kept getting <QtCore/qchar.h> not found or unknown argument: -fno-keep-inline-dllexport. I attempted a thorough search across the web but failed to find a solution to be able to build.

    So I thought maybe there was a special step for Windows 10? or maybe for Windows in general?

    I dunno, so I'm seeking help from you guys.

    Edit:
    I'm using Qt Creator 4.6.0 (Based on Qt 5.10.1 (Clang 7.0 (Apple), 64 bit). QMake has the flag -spec macx-clang and CONFIG += x86_64.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The application bundle is just a folder with the .app extension. Are you sure your first friend didn't go into the folder to execute the application itself ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      ResistorInTheDarkR 1 Reply Last reply
      1
      • ResistorInTheDarkR Offline
        ResistorInTheDarkR Offline
        ResistorInTheDark
        wrote on last edited by ResistorInTheDark
        #3

        Hullo, thanks for your reply.

        It turns out that my friend used one or two third-party apps to open the app I sent him. (Because I sent my app to him in a .zip so he went ahead and found a zip opener).

        My second friend didn't use any third-party apps (directly copied the application of my flash drive). This might (hopefully) explain the issue I had.

        I've already asked my first friend which apps he used. I expect a reply from him in less than two/three days time.

        Thanks for taking your time, @SGaist.

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          The application bundle is just a folder with the .app extension. Are you sure your first friend didn't go into the folder to execute the application itself ?

          ResistorInTheDarkR Offline
          ResistorInTheDarkR Offline
          ResistorInTheDark
          wrote on last edited by
          #4

          @SGaist

          Alright...
          Friend #1 used an application called WinZip and somehow unpacked the applications (which I sent in a .zip file which also contained a .db and a README.txt).

          I told friend #2 to download WinZip. He did. Unzipped the folders. Tells me is still a bunch of folders.

          So no indeed, my first friend didn't go into the folder to execute the application itself.

          My second friend (the one using Windows 10) further informs me that the application inside the .app folder (what would be a Unix Executable on my Mac) has type File.
          If he tries to rename the file to have a .exe extension, he gets a "This app can't run on your PC" error pop-up.

          That's the extra info I got.

          jsulmJ 1 Reply Last reply
          0
          • ResistorInTheDarkR ResistorInTheDark

            @SGaist

            Alright...
            Friend #1 used an application called WinZip and somehow unpacked the applications (which I sent in a .zip file which also contained a .db and a README.txt).

            I told friend #2 to download WinZip. He did. Unzipped the folders. Tells me is still a bunch of folders.

            So no indeed, my first friend didn't go into the folder to execute the application itself.

            My second friend (the one using Windows 10) further informs me that the application inside the .app folder (what would be a Unix Executable on my Mac) has type File.
            If he tries to rename the file to have a .exe extension, he gets a "This app can't run on your PC" error pop-up.

            That's the extra info I got.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @ResistorInTheDark said in Building a Release for Windows 10 from Mac OS:

            My second friend (the one using Windows 10) further informs me that the application inside the .app folder

            Sounds like you sent MacOS version of your app to your friend #2...

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

            ResistorInTheDarkR 1 Reply Last reply
            1
            • jsulmJ jsulm

              @ResistorInTheDark said in Building a Release for Windows 10 from Mac OS:

              My second friend (the one using Windows 10) further informs me that the application inside the .app folder

              Sounds like you sent MacOS version of your app to your friend #2...

              ResistorInTheDarkR Offline
              ResistorInTheDarkR Offline
              ResistorInTheDark
              wrote on last edited by ResistorInTheDark
              #6

              @jsulm That is accurate. Any idea how to build a release version for Windows 10?

              jsulmJ J.HilkJ 2 Replies Last reply
              0
              • ResistorInTheDarkR ResistorInTheDark

                @jsulm That is accurate. Any idea how to build a release version for Windows 10?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @ResistorInTheDark Somehow I don't really understand - "I built a release version that could run on my Mac and sent it to a friend to try it out. He uses Windows 7. It works.". How can a MacOS build of your app work on Windows?

                To get a Windows build you will need to build on Windows. Either use a machine with Windows or a Virtual Machine.

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

                ResistorInTheDarkR 1 Reply Last reply
                2
                • ResistorInTheDarkR ResistorInTheDark

                  @jsulm That is accurate. Any idea how to build a release version for Windows 10?

                  J.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #8

                  @ResistorInTheDark
                  You're going to have a tough time setting up a cross compile chain from MacOS to Windows. It's possible, this StackOverflow thread may help you.
                  Besides the obvious hassels, you'll also have to crosscompile the whole Qt libabry, in the end, you're much better of by simply creating a vm and runnning windows & compiling of from that.


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  1 Reply Last reply
                  4
                  • jsulmJ jsulm

                    @ResistorInTheDark Somehow I don't really understand - "I built a release version that could run on my Mac and sent it to a friend to try it out. He uses Windows 7. It works.". How can a MacOS build of your app work on Windows?

                    To get a Windows build you will need to build on Windows. Either use a machine with Windows or a Virtual Machine.

                    ResistorInTheDarkR Offline
                    ResistorInTheDarkR Offline
                    ResistorInTheDark
                    wrote on last edited by
                    #9

                    Thanks for the quick replies.

                    @jsulm I'm not entirely sure how he did it. He told me he pulled it out of the zip file using WinZip and it ran fine.

                    @J.Hilk Okay then, I think I might run and compile from Windows. I've told my friend to download Qt. Hopefully everything goes well then.

                    jsulmJ 1 Reply Last reply
                    0
                    • ResistorInTheDarkR ResistorInTheDark

                      Thanks for the quick replies.

                      @jsulm I'm not entirely sure how he did it. He told me he pulled it out of the zip file using WinZip and it ran fine.

                      @J.Hilk Okay then, I think I might run and compile from Windows. I've told my friend to download Qt. Hopefully everything goes well then.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @ResistorInTheDark Your friend should not download Qt to run your app, instead you should deploy it to create a package containing all needed libraries. See here for Windows: https://doc.qt.io/Qt-5/windows-deployment.html

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

                      ResistorInTheDarkR 1 Reply Last reply
                      1
                      • jsulmJ jsulm

                        @ResistorInTheDark Your friend should not download Qt to run your app, instead you should deploy it to create a package containing all needed libraries. See here for Windows: https://doc.qt.io/Qt-5/windows-deployment.html

                        ResistorInTheDarkR Offline
                        ResistorInTheDarkR Offline
                        ResistorInTheDark
                        wrote on last edited by
                        #11

                        @jsulm I can't seem to find the windeployqt executable in the Qt folders. I've found a macdeployqt, but no windeployqt. Is there a direct download link for this, perhaps?

                        jsulmJ 1 Reply Last reply
                        0
                        • ResistorInTheDarkR ResistorInTheDark

                          @jsulm I can't seem to find the windeployqt executable in the Qt folders. I've found a macdeployqt, but no windeployqt. Is there a direct download link for this, perhaps?

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @ResistorInTheDark Yes, that's because you're on a Mac with Mac version of Qt. As I said you need a Windows machine.

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

                          ResistorInTheDarkR 1 Reply Last reply
                          1
                          • jsulmJ jsulm

                            @ResistorInTheDark Yes, that's because you're on a Mac with Mac version of Qt. As I said you need a Windows machine.

                            ResistorInTheDarkR Offline
                            ResistorInTheDarkR Offline
                            ResistorInTheDark
                            wrote on last edited by
                            #13

                            @jsulm Okay. So right now I have access to my friend's computer (Windows 10). He doesn't have Qt installed (as you have advised). But he also doesn't seem to have the windeployqt.exe.

                            jsulmJ 1 Reply Last reply
                            0
                            • ResistorInTheDarkR ResistorInTheDark

                              @jsulm Okay. So right now I have access to my friend's computer (Windows 10). He doesn't have Qt installed (as you have advised). But he also doesn't seem to have the windeployqt.exe.

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by jsulm
                              #14

                              @ResistorInTheDark Why should your friend have windeployqt? It's your job to deploy the app for all platforms/OS you want to support.
                              So, again: you need Windows machine with a compiler (MinGW or VC++) and Qt. Then build your app there and use windeployqt to deploy your app and then send the result to your friend.
                              And I did NOT adviced that your friend needs to install Qt! You should read more careful what others write...

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

                              ResistorInTheDarkR 1 Reply Last reply
                              2
                              • jsulmJ jsulm

                                @ResistorInTheDark Why should your friend have windeployqt? It's your job to deploy the app for all platforms/OS you want to support.
                                So, again: you need Windows machine with a compiler (MinGW or VC++) and Qt. Then build your app there and use windeployqt to deploy your app and then send the result to your friend.
                                And I did NOT adviced that your friend needs to install Qt! You should read more careful what others write...

                                ResistorInTheDarkR Offline
                                ResistorInTheDarkR Offline
                                ResistorInTheDark
                                wrote on last edited by
                                #15

                                @jsulm Thanks for your comments. Perhaps my post caused a misunderstanding. I meant that you advised to not have Qt installed.

                                Right now, I'll continue installing Qt for Windows.

                                jsulmJ 1 Reply Last reply
                                0
                                • ResistorInTheDarkR ResistorInTheDark

                                  @jsulm Thanks for your comments. Perhaps my post caused a misunderstanding. I meant that you advised to not have Qt installed.

                                  Right now, I'll continue installing Qt for Windows.

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  @ResistorInTheDark said in Building a Release for Windows 10 from Mac OS:

                                  I meant that you advised to not have Qt installed

                                  Yes, you should deploy your app with everything it needs to run, including Qt libraries. Then your users do not have to install Qt. This is how applications are distributed.

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

                                  ResistorInTheDarkR 1 Reply Last reply
                                  1
                                  • jsulmJ jsulm

                                    @ResistorInTheDark said in Building a Release for Windows 10 from Mac OS:

                                    I meant that you advised to not have Qt installed

                                    Yes, you should deploy your app with everything it needs to run, including Qt libraries. Then your users do not have to install Qt. This is how applications are distributed.

                                    ResistorInTheDarkR Offline
                                    ResistorInTheDarkR Offline
                                    ResistorInTheDark
                                    wrote on last edited by
                                    #17

                                    @jsulm That makes sense then. My friend is not a user, he's a tester. So his computer is technically part of my assets. Perhaps that helps clarify something.

                                    I apologise for my inexperience in this field.

                                    1 Reply Last reply
                                    0
                                    • ResistorInTheDarkR Offline
                                      ResistorInTheDarkR Offline
                                      ResistorInTheDark
                                      wrote on last edited by ResistorInTheDark
                                      #18

                                      Alright, after installing Qt on Windows and building from a Windows machine, the application was able to be compiled and ran successfully with very minor differences compared to the deployment on Mac.

                                      Marking as solved. Thanks @SGaist @jsulm @J-Hilk @Ratzz. :-)

                                      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