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. Help making my Qt program cross-platform.
Forum Updated to NodeBB v4.3 + New Features

Help making my Qt program cross-platform.

Scheduled Pinned Locked Moved General and Desktop
13 Posts 4 Posters 3.7k 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.
  • B Offline
    B Offline
    bresser
    wrote on 10 May 2013, 13:32 last edited by
    #1

    Ok so using Qt on Linux Ubuntu 12.04. I designed a GUI application that just encrypts a message. I want to make it so It works on Windows.

    So that leaves me with two questions.

    1. How do I know the dependencies of my program?
    2. How do I find those dependencies in the Qt folder?
    1 Reply Last reply
    0
    • R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 10 May 2013, 14:00 last edited by
      #2

      As i undertood you right you want to copy your linux compiled binary files to windows with all it's dependencies?!
      If yes, that's not what it's meant by "cross-platform compatibility" ;) Only the source code you write in Qt is ... so you have to compile your source code on a windows machine against a windows-compiled Qt version.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bresser
        wrote on 10 May 2013, 14:23 last edited by
        #3

        well I know that I don't have to compile it on a Windows computer. I want to just include with executable, the libraries we need. That way everybody that uses it doesn't have to download Qt. Or if someone could point me to an article that tells me how to make a Install wizard that downloads the libraries for the program that would also be fine.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mario84
          wrote on 10 May 2013, 14:29 last edited by
          #4

          There are tools that let you compile a windows *.exe on a linux machine, but you definitely have to compile 2 separate binaries...
          And this would also apply to your install wizard...

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on 10 May 2013, 14:30 last edited by
            #5

            How do you know the dependencies of a linux application? ldd /your/application is your friend there.

            The binaries you build on Linux will not work on Windows though. You can try to cross-compile the code for Windows on a Linux platform with mingw, but that is an advanced topic. In any case you will need to test your binaries on all platforms to make sure they work properly everywhere.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bresser
              wrote on 10 May 2013, 14:30 last edited by
              #6

              Ok then what would one of those tools be?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mario84
                wrote on 10 May 2013, 14:33 last edited by
                #7

                [quote author="Tobias Hunger" date="1368196219"]In any case you will need to test your binaries on all platforms to make sure they work properly everywhere.[/quote]

                ...and if you use windows for testing, you can use it for compilation as well, that's much easier ;)

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bresser
                  wrote on 10 May 2013, 14:39 last edited by
                  #8

                  Ok so If i download and install Qt on a windows computer can i delete it off after I'm done compiling and my program still work?

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mario84
                    wrote on 10 May 2013, 14:42 last edited by
                    #9

                    yes, but you have to deploy the correct qt-dlls with it

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      tobias.hunger
                      wrote on 10 May 2013, 14:42 last edited by
                      #10

                      Not if your program actually uses Qt. It will need (some) of the shared libraries then. Dependency walker will show which. Please make sure you also include the plugins to the libs you need. Dependency walker will most likely not list those as they are not linked into the binaries (that is why they are plugins;-).

                      Tools like strace on linux and a file system monitor (not sure what the name was, it is part of the sysinternal tools IIRC) will help to catch those.

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        bresser
                        wrote on 10 May 2013, 17:14 last edited by
                        #11

                        I don't think It actually uses Qt. It uses Qt types though. (QString, QComboBox, QByteArray, QString, QTextEdit, QLabel). And I'm on linux So i can't use Dependency Walker. Is there a linux version? And Where can I find the plugins for the Libraries.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          tobias.hunger
                          wrote on 10 May 2013, 17:29 last edited by
                          #12

                          bq. I don’t think It actually uses Qt. It uses Qt types though. (QString, QComboBox, QByteArray, QString, QTextEdit, QLabel).

                          That is "using Qt".

                          bq. And I’m on linux So i can’t use Dependency Walker.

                          See my previous post: ldd /your/application is your friend there.

                          bq. And Where can I find the plugins for the Libraries.

                          That depends on the library. strace will show you what your program tries to open (grep for "^open").

                          On linux you might want to do packages for your distribution(s) of choice. You just need to depend on the Qt packages then and don't need to bother about plugins, etc. The package management will make sure they are available for you.

                          On windows on the other hand you will need to copy the libraries and plugins yourself into the right places. There is some documentation on moving Qt libraries around... since there are paths compiled into the binary that is not straight forward. You will want to read up on that for windows.

                          1 Reply Last reply
                          0
                          • B Offline
                            B Offline
                            bresser
                            wrote on 10 May 2013, 17:36 last edited by
                            #13

                            linux-gate.so.1 => (0xb779f000)
                            libQtGui.so.4 => /usr/lib/i386-linux-gnu/libQtGui.so.4 (0xb6cb0000)
                            libQtCore.so.4 => /usr/lib/i386-linux-gnu/libQtCore.so.4 (0xb69d3000)
                            libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb68ed000)
                            libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb68cf000)
                            libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6726000)
                            libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xb66f2000)
                            libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb66d7000)
                            libaudio.so.2 => /usr/lib/i386-linux-gnu/libaudio.so.2 (0xb66bd000)
                            libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb65c4000)
                            libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xb659a000)
                            libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6584000)
                            libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xb64ea000)
                            libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xb649a000)
                            libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0xb6491000)
                            libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0xb6477000)
                            libXi.so.6 => /usr/lib/i386-linux-gnu/libXi.so.6 (0xb6467000)
                            libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xb645d000)
                            libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xb644a000)
                            libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xb6316000)
                            libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb62ea000)
                            libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb62e5000)
                            librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb62dc000)
                            /lib/ld-linux.so.2 (0xb77a0000)
                            libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xb62b1000)
                            libXt.so.6 => /usr/lib/i386-linux-gnu/libXt.so.6 (0xb6255000)
                            libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xb6251000)
                            libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb6215000)
                            libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0xb620e000)
                            libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0xb6207000)
                            libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb61e6000)
                            libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xb61df000)

                            That is all that it gives me for ldd. do I need all of these?

                            1 Reply Last reply
                            0

                            1/13

                            10 May 2013, 13:32

                            • Login

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