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. Question about cross platform programming in Qt
Forum Updated to NodeBB v4.3 + New Features

Question about cross platform programming in Qt

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 3.5k Views 1 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.
  • R Offline
    R Offline
    ravens
    wrote on last edited by
    #1

    Hello, i have a few questions.
    Can i compile my program into one file and have it run on windows, mac, and Linux?
    How does Qt's cross platform ability work?
    Thank you very much!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      [quote author="ravens" date="1333920814"]Can i compile my program into one file and have it run on windows, mac, and Linux?[/quote]

      No, you have to build your application for each platform that you target. Qt is cross platform because same source code runs successfully on different platforms after it is build for them.

      http://anavi.org/

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ravens
        wrote on last edited by
        #3

        Ah, so i will need to compile it 3 times on 3 different OS's or from 1 OS?
        There would be no way to load the correct code using preprocessors to determine the OS?
        Thanks for the help.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          leon.anavi
          wrote on last edited by
          #4

          Yes, please check the following articles for details about Qt on the three platforms that you are interested in:

          • "Qt on Windows":http://qt-project.org/wiki/Support_for_Windows
          • "Qt on Mac OS X":http://qt-project.org/wiki/Support_for_Mac_OS_X
          • "Qt on Linux/X11":http://qt-project.org/wiki/Support_for_Linux_X11

          http://anavi.org/

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            No, you cannot create one single executable file that will execute on all three platforms. You really have to generatel separate executables.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leon.anavi
              wrote on last edited by
              #6

              [quote author="leon.anavi" date="1333922138"]Yes[/quote]

              [quote author="Andre" date="1333968057"]No, you cannot create one single executable file that will execute on all three platforms. You really have to generatel separate executables. [/quote]

              Just to avoid misunderstands I would like to point out that my positive answer was about the statement that the source has to be build 3 times to target all of the platforms :)

              http://anavi.org/

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dbzhang800
                wrote on last edited by
                #7

                In fact, this is a pure C++ problem. As you can't compile your C++ program into one file and have it run on windows, mac, and Linux.

                However, if you using pure qml, there is another problem.

                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