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. Compiling QT VS project cross platform

Compiling QT VS project cross platform

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 1.6k Views 2 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.
  • MecanikM Offline
    MecanikM Offline
    Mecanik
    wrote on last edited by
    #1

    Hello,

    Please accept my apologies for the newbie question; I never compiled any apps cross platform.

    There is a project I am working on, setup using VS 2019 with QT integration. My question is how would I compile this for MAC/Linux for example? (everything written using QT 6 only, no other dependencies).

    Do I need to create a separate project or can I use this existing one?

    Please advise.

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

      Hi,

      Currently you can't cross-compile to macOS, this requires a machine for it.

      For Linux, might be able to leverage MinGW.

      However with the current release of WSL, you might not need to do cross-compiling.

      But in any case, you do not need several projects.

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

      MecanikM 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Currently you can't cross-compile to macOS, this requires a machine for it.

        For Linux, might be able to leverage MinGW.

        However with the current release of WSL, you might not need to do cross-compiling.

        But in any case, you do not need several projects.

        MecanikM Offline
        MecanikM Offline
        Mecanik
        wrote on last edited by
        #3

        @SGaist said in Compiling QT VS project cross platform:

        Hi,

        Currently you can't cross-compile to macOS, this requires a machine for it.

        For Linux, might be able to leverage MinGW.

        However with the current release of WSL, you might not need to do cross-compiling.

        But in any case, you do not need several projects.

        Thank you, appreciate the feedback. I understand about macOS; that's fine. However for Linux, I do have WSL installed (using it for other stuff; no UI though).

        You mention I can keep my existing VS project and compile with MinGW, do you have any tips/instructions that I could use?

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

          One thing to clear, are you using a VS project or a qmake/cmake based project to manage your application ?

          If the former, then no, not directly. You should move to one of the larger taking into account that Qt has switched to cmake for its 6 series.

          With that you will be able to build your application across different platforms.

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

          MecanikM 1 Reply Last reply
          1
          • SGaistS SGaist

            One thing to clear, are you using a VS project or a qmake/cmake based project to manage your application ?

            If the former, then no, not directly. You should move to one of the larger taking into account that Qt has switched to cmake for its 6 series.

            With that you will be able to build your application across different platforms.

            MecanikM Offline
            MecanikM Offline
            Mecanik
            wrote on last edited by
            #5

            @SGaist said in Compiling QT VS project cross platform:

            One thing to clear, are you using a VS project or a qmake/cmake based project to manage your application ?

            If the former, then no, not directly. You should move to one of the larger taking into account that Qt has switched to cmake for its 6 series.

            With that you will be able to build your application across different platforms.

            I am using a VS solution with QT addon and QT6. Do you think I can keep the VS solution and compile for Linux as well?

            Christian EhrlicherC 1 Reply Last reply
            0
            • MecanikM Mecanik

              @SGaist said in Compiling QT VS project cross platform:

              One thing to clear, are you using a VS project or a qmake/cmake based project to manage your application ?

              If the former, then no, not directly. You should move to one of the larger taking into account that Qt has switched to cmake for its 6 series.

              With that you will be able to build your application across different platforms.

              I am using a VS solution with QT addon and QT6. Do you think I can keep the VS solution and compile for Linux as well?

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Mecanik said in Compiling QT VS project cross platform:

              Do you think I can keep the VS solution and compile for Linux as well?

              No, a .vcproj is MSVC specific. Use a proper build system like cmake or qmake to create the appropriate Makefiles (or VS solutions).

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

              MecanikM 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                @Mecanik said in Compiling QT VS project cross platform:

                Do you think I can keep the VS solution and compile for Linux as well?

                No, a .vcproj is MSVC specific. Use a proper build system like cmake or qmake to create the appropriate Makefiles (or VS solutions).

                MecanikM Offline
                MecanikM Offline
                Mecanik
                wrote on last edited by
                #7

                @Christian-Ehrlicher said in Compiling QT VS project cross platform:

                @Mecanik said in Compiling QT VS project cross platform:

                Do you think I can keep the VS solution and compile for Linux as well?

                No, a .vcproj is MSVC specific. Use a proper build system like cmake or qmake to create the appropriate Makefiles (or VS solutions).

                Thanks, that's what I imagined. So how about me using a QT project file instead? That would allow me to use MinGW and compile for both Windows/Linux, am I correct?

                1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Mecanik said in Compiling QT VS project cross platform:

                  So how about me using a QT project file instead?

                  I don't know what you mean with 'QT project file' - if it's a .pro - file then you're using qmake which is fine (as I said above).

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

                  MecanikM 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    @Mecanik said in Compiling QT VS project cross platform:

                    So how about me using a QT project file instead?

                    I don't know what you mean with 'QT project file' - if it's a .pro - file then you're using qmake which is fine (as I said above).

                    MecanikM Offline
                    MecanikM Offline
                    Mecanik
                    wrote on last edited by
                    #9

                    @Christian-Ehrlicher said in Compiling QT VS project cross platform:

                    @Mecanik said in Compiling QT VS project cross platform:

                    So how about me using a QT project file instead?

                    I don't know what you mean with 'QT project file' - if it's a .pro - file then you're using qmake which is fine (as I said above).

                    Yep, that's what I meant - qmake. Thanks!

                    I suppose same thing applies for macOS, I can install QT on my mac and compile using qmake?

                    jsulmJ MecanikM 2 Replies Last reply
                    0
                    • MecanikM Mecanik

                      @Christian-Ehrlicher said in Compiling QT VS project cross platform:

                      @Mecanik said in Compiling QT VS project cross platform:

                      So how about me using a QT project file instead?

                      I don't know what you mean with 'QT project file' - if it's a .pro - file then you're using qmake which is fine (as I said above).

                      Yep, that's what I meant - qmake. Thanks!

                      I suppose same thing applies for macOS, I can install QT on my mac and compile using qmake?

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

                      @Mecanik said in Compiling QT VS project cross platform:

                      I can install QT on my mac and compile using qmake?

                      Yes

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

                      1 Reply Last reply
                      0
                      • MecanikM Mecanik

                        @Christian-Ehrlicher said in Compiling QT VS project cross platform:

                        @Mecanik said in Compiling QT VS project cross platform:

                        So how about me using a QT project file instead?

                        I don't know what you mean with 'QT project file' - if it's a .pro - file then you're using qmake which is fine (as I said above).

                        Yep, that's what I meant - qmake. Thanks!

                        I suppose same thing applies for macOS, I can install QT on my mac and compile using qmake?

                        MecanikM Offline
                        MecanikM Offline
                        Mecanik
                        wrote on last edited by
                        #11

                        @Mecanik said in Compiling QT VS project cross platform:

                        @Christian-Ehrlicher said in Compiling QT VS project cross platform:

                        @Mecanik said in Compiling QT VS project cross platform:

                        So how about me using a QT project file instead?

                        I don't know what you mean with 'QT project file' - if it's a .pro - file then you're using qmake which is fine (as I said above).

                        Yep, that's what I meant - qmake. Thanks!

                        I suppose same thing applies for macOS, I can install QT on my mac and compile using qmake?

                        Awesome, thank you all!

                        1 Reply Last reply
                        0

                        • Login

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