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. Whats are the steps to execute a program in linux which is developed in windows?

Whats are the steps to execute a program in linux which is developed in windows?

Scheduled Pinned Locked Moved General and Desktop
11 Posts 8 Posters 7.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.
  • A Offline
    A Offline
    aurora
    wrote on last edited by
    #1

    I am using "Qt Creator 2.3.0 ,Based on Qt 4.7.4 (32 bit)"
    I developed a GUI program which executes correctly in windows now i want to get its executable, to run in linux. Please tell me how can i do that?

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yasin
      wrote on last edited by
      #2

      Install Qt SDK in Linux then compile your program's source code.

      Yasin Gorgij

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        A Qt application is platform-independent in a way that it can be compiled everywhere, not run. This means, that you'll have to compile your application for every platform you want to support, which results in one binary for each platform (not one binary for all platforms).

        As Yasin already said just download the Qt SDK for Linux and compile it there.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Anticross
          wrote on last edited by
          #4

          And one more question: If I use Visual Studio and have *.sln and *.vcproj files, how can I fast export it to Qt Creator. My solution is to make new project in Qt Creator and then add all *.ccp and *.h files. So it there any conversation tools or any tricks to make it faster?

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            If your program doesn't use any specific Windows characteristic, you only have to install Qt Creator with the package manager of your Linux distribution:

            Ubuntu:

            aptitude install qtcreator

            Fedora:

            yum install qt-creator

            ...finally just compile your project.

            Bold: I mean with this, by example: lets say your program accesses a folder, a typical Windows direction would be:

            C:\Users\SomeUser

            ...the analog folder on Linux is:

            /home/SomeUser

            ...as you can see the addresses are not equal, so you have to adapt this part of your code, other wise your project will compile fine, but you will get a run time error.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on last edited by
              #6

              [quote author="Anticross" date="1326869815"]And one more question: If I use Visual Studio and have *.sln and *.vcproj files, how can I fast export it to Qt Creator. My solution is to make new project in Qt Creator and then add all *.ccp and *.h files. So it there any conversation tools or any tricks to make it faster?[/quote]
              Go to your source code directory and type <code>qmake -project</code>.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                [quote author="Anticross" date="1326869815"]And one more question: If I use Visual Studio and have *.sln and *.vcproj files, how can I fast export it to Qt Creator. My solution is to make new project in Qt Creator and then add all *.ccp and *.h files. So it there any conversation tools or any tricks to make it faster?[/quote]

                If you use the visual studio plugin, there's a menu entry to export the project to a .pro file.

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Asperamanca
                  wrote on last edited by
                  #8

                  The two biggest (well, "biggest" is too big a word) hurdles I encountered were:

                  -) Source file case (Linux is case sensitive, Windows is not)

                  A good approach is to use only lowercase file names.

                  -) How you write #include directives (some things that work on Windows don't work on Linux)

                  e.g.
                  @#include <QString.h> @
                  might work in Windows, it will not work in Linux.
                  @#include <QString> @
                  will work on both.

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    joonhwan
                    wrote on last edited by
                    #9

                    Even though window file system handles file path in-casesensitively, it keeps the case of each character.
                    I believe there is no such QString.h in Qt header directory but only qstring.h(and 'QString' without extension)

                    joonhwan at gmail dot com

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Asperamanca
                      wrote on last edited by
                      #10

                      But
                      @#include <QString.h>@
                      does work in Windows, using the Qt SDK.

                      I know for a fact it does not work in Linux. Hence the warning.

                      I have seen people, especially those working on Visual Studio, using ways of including Qt headers that do not work in Linux.
                      Example:

                      @#include <QtCore/qpair.h>@
                      does not work in Linux

                      @#include <QPair>@
                      does work.

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        goetz
                        wrote on last edited by
                        #11

                        Of course it does work, because QString.h and qstring.h (and as well QSTRING.H or qStRiNg.H) are all the same file. On Unix/Linux these are different files. On the Mac the filesystem usually (default settings) is case-IN-sensitive either, as on Windows.

                        The recommended way to include directives in C++ in general is

                        @
                        #include <QString>
                        @

                        i.e. using case (if used in the API docs) and without a trailing .h - this is expected to be portable across all platforms.

                        If you do differently, you might run into troubles.

                        http://www.catb.org/~esr/faqs/smart-questions.html

                        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