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. Can I compile for Linux my applications?
Forum Updated to NodeBB v4.3 + New Features

Can I compile for Linux my applications?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 1.2k 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.
  • Z Offline
    Z Offline
    ZekDe
    wrote on last edited by tekojo
    #1

    Hi friends,
    The codes that I wrote I would like to compile to linux. Is it possible it.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      How can we know that? We have not seen your code, we don't know if you are using any platform-specific APIs etc.

      In general, if you have written an application in Qt, then the answer is yes - you can compile it on any platform supported by Qt (Linux, Windows, macOS, iOS, Android, and others).

      (Z(:^

      1 Reply Last reply
      5
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        Yes it is ( if pure Qt) . just install a linux with compiler tools +Qt
        and the project can just compile :)

        Most easy is to use virtual machine for that.

        Its also possible to cross compile for linux from windows, but
        its expert level and completely outside Qt.
        Unless you are a tool chain geek, it will/ might take days.

        Much, much easier to setup a virtual linux and have fun.
        https://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox
        on a SSD disk it takes may 30 mins to be ready with Qt and all.

        1 Reply Last reply
        4
        • Z Offline
          Z Offline
          ZekDe
          wrote on last edited by tekojo
          #4

          I mean,if I write a code on Java ,programs run on any platform as far as I know ,I never use java,but persons who use it say like this. So that when I write code on windows,Can I run it on linux?I suppose my question is now better.

          sierdzioS J.HilkJ jsulmJ 3 Replies Last reply
          0
          • Z ZekDe

            I mean,if I write a code on Java ,programs run on any platform as far as I know ,I never use java,but persons who use it say like this. So that when I write code on windows,Can I run it on linux?I suppose my question is now better.

            sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            @ZekDe said in Can I compile for Linux my applications?:

            So that when I write code on windows,Can I run it on linux?

            No, it's not possible. Each platform and CPU architecture has a very distinct binary format and they are not interchangeable.

            There are Windows emulators like Wine which can run your Windows binaries on Linux.

            (Z(:^

            1 Reply Last reply
            1
            • Z ZekDe

              I mean,if I write a code on Java ,programs run on any platform as far as I know ,I never use java,but persons who use it say like this. So that when I write code on windows,Can I run it on linux?I suppose my question is now better.

              J.HilkJ Online
              J.HilkJ Online
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @ZekDe Telling someone to use Java, because it runs on all platforms is like telling someone "Get a Tank, it drives on all roads and even offroad!"

              That said, even using pure Java /JS you'll need platform specific lowlevel nativ code.

              If you use only Pure Qt-Classes, than you can create from one single source code, programms/Apps for nearly all common OS


              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
              2
              • Z ZekDe

                I mean,if I write a code on Java ,programs run on any platform as far as I know ,I never use java,but persons who use it say like this. So that when I write code on windows,Can I run it on linux?I suppose my question is now better.

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

                @ZekDe If you use C++/Qt you need to build your app for each platform you want to support. So, to support Linux you need to build it for Linux as people suggested above. C++ is not Java.

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

                1 Reply Last reply
                1
                • mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi
                  Java is interpreted.
                  C++ is compiled.

                  if you want to know the difference, please see here
                  https://www.upwork.com/hiring/development/the-basics-of-compiled-languages-interpreted-languages-and-just-in-time-compilers/

                  There is no magic to java. its need support for the platform or it cant run.

                  1 Reply Last reply
                  1
                  • Z Offline
                    Z Offline
                    ZekDe
                    wrote on last edited by ZekDe
                    #9

                    Thanks all information ,
                    as far as I understand,I have to use virtual machine for it, and my problem will end.Also tank story is made me laugh :)

                    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