Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Building a Release for Windows 10 from Mac OS

    Installation and Deployment
    4
    18
    2485
    Loading More Posts
    • 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.
    • ResistorInTheDark
      ResistorInTheDark last edited by ResistorInTheDark

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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

        ResistorInTheDark 1 Reply Last reply Reply Quote 1
        • ResistorInTheDark
          ResistorInTheDark last edited by ResistorInTheDark

          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 Reply Quote 0
          • ResistorInTheDark
            ResistorInTheDark @SGaist last edited by

            @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.

            jsulm 1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @ResistorInTheDark last edited by

              @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

              ResistorInTheDark 1 Reply Last reply Reply Quote 1
              • ResistorInTheDark
                ResistorInTheDark @jsulm last edited by ResistorInTheDark

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

                jsulm J.Hilk 2 Replies Last reply Reply Quote 0
                • jsulm
                  jsulm Lifetime Qt Champion @ResistorInTheDark last edited by

                  @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

                  ResistorInTheDark 1 Reply Last reply Reply Quote 2
                  • J.Hilk
                    J.Hilk Moderators @ResistorInTheDark last edited by

                    @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

                    Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


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

                    1 Reply Last reply Reply Quote 4
                    • ResistorInTheDark
                      ResistorInTheDark @jsulm last edited by

                      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.

                      jsulm 1 Reply Last reply Reply Quote 0
                      • jsulm
                        jsulm Lifetime Qt Champion @ResistorInTheDark last edited by

                        @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

                        ResistorInTheDark 1 Reply Last reply Reply Quote 1
                        • ResistorInTheDark
                          ResistorInTheDark @jsulm last edited by

                          @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?

                          jsulm 1 Reply Last reply Reply Quote 0
                          • jsulm
                            jsulm Lifetime Qt Champion @ResistorInTheDark last edited by

                            @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

                            ResistorInTheDark 1 Reply Last reply Reply Quote 1
                            • ResistorInTheDark
                              ResistorInTheDark @jsulm last edited by

                              @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.

                              jsulm 1 Reply Last reply Reply Quote 0
                              • jsulm
                                jsulm Lifetime Qt Champion @ResistorInTheDark last edited by 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...

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

                                ResistorInTheDark 1 Reply Last reply Reply Quote 2
                                • ResistorInTheDark
                                  ResistorInTheDark @jsulm last edited by

                                  @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.

                                  jsulm 1 Reply Last reply Reply Quote 0
                                  • jsulm
                                    jsulm Lifetime Qt Champion @ResistorInTheDark last edited by

                                    @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

                                    ResistorInTheDark 1 Reply Last reply Reply Quote 1
                                    • ResistorInTheDark
                                      ResistorInTheDark @jsulm last edited by

                                      @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 Reply Quote 0
                                      • ResistorInTheDark
                                        ResistorInTheDark last edited by ResistorInTheDark

                                        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 Reply Quote 2
                                        • First post
                                          Last post