Results 1 to 5 of 5

Thread: Portability of Dynamic / Static version of my own application

  1. #1
    Join Date
    Jan 2011
    Posts
    19
    Thanks
    4

    Default Portability of Dynamic / Static version of my own application

    Hello,

    I'm trying to make my application portable.

    So i want 4 versions :
    - 1 static 64 bits
    - 1 dynamic 64 bits
    And both in 32 bits too.

    First, i will do the first group, in 64 bits.


    ===== DYNAMIC VERSION =====

    My program is by default, compiled in dynamic i guess. So, i put the binary file on another computer and trying to run it :
    error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
    So i tried to copy the file libQtGui.so.4 from the lib directory, into the folder which contains the binary file. It's the same issue. So I think i forgot something but dunno what.


    ===== STATIC VERSION =====
    I download the library source, and I do these commands :
    ./configure -static -release -prefix /usr/local/Trolltech/Qt-4.8.1_static
    gmake
    gmake install
    I add manually the static qmake on Qt Creator, i delete the .pro.user and i restart Qt Creator. Now i select the static version of compiler and i compile my application.
    In dynamic version, its size is 640ko and in static : 18 mo. I think the static linking worked successfully.

    There is a graphical issue when i starts the program.
    When it starts, it ask you to select a folder.
    2 screens, one in dynamic and the other, in static :
    1334353392-Capturedu2012-04-13234137.jpg 1334353396-Capturedu2012-04-13234111.png

    After that, the program in static version is very ugly... A slider is missing on the IHM. It is strange..

    Note : I read somewhere that if I use Thread, it's not useful to make static version because I have to keep one library file, but i don't remember its name.

    I tried to start the static version on another computer, and i had an error :
    ./Tairona-visue: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./Tairona-visue)
    But the libc6 is installed in this system, and the distribution is fully up to date...

    Thanks in advance for your help, and sorry for my bad english !
    Last edited by Selven; 13th April 2012 at 22:56. Reason: updated contents

  2. #2
    Join Date
    Feb 2012
    Location
    Pakistan
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Portability of Dynamic / Static version of my own application

    i can give you a hint on the first problem.the dynamic build that you have will need a compiler dll file too if mingGw compiler you will need something like mingdll-4 and for visual studio its something like ms something.so a compiler dll file and the Qt module dll that you have used in your application.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Portability of Dynamic / Static version of my own application

    Quote Originally Posted by Selven View Post
    So i tried to copy the file libQtGui.so.4 from the lib directory, into the folder which contains the binary file. It's the same issue. So I think i forgot something but dunno what.
    You forgot that you're on Linux and not Windows. Linux doesn't search for libraries in the current directory.

    There is a graphical issue when i starts the program.
    When it starts, it ask you to select a folder.
    2 screens, one in dynamic and the other, in static :
    1334353392-Capturedu2012-04-13234137.jpg 1334353396-Capturedu2012-04-13234111.png

    After that, the program in static version is very ugly...
    It is because you didn't link widget style plugins against your static app. Even if you do there is a good chance someone uses a custom widget style you won't be able to load into your static app anyway.

    Note : I read somewhere that if I use Thread, it's not useful to make static version because I have to keep one library file, but i don't remember its name.
    That's not true, threads have nothing to do with how your application needs to be compliled. Qt is multithreaded regardless if you use threads or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Jan 2011
    Posts
    19
    Thanks
    4

    Default Re: Portability of Dynamic / Static version of my own application

    So, what is the directive to add to the $PATH, in order that linux searches in the current directory ?
    I don't find it on the documentation and on the internet, when i searches my error return, i have only some terminal commands for install Qt libraries... That's not what I want..

    For graphical issue:
    If i understand, you recommend to compile only in dynamic ? Because if someone uses a custom widget style, there can be a problem...

    About threads :
    Okay, so i heards something wrong... Thanks for your correction !

    Thanks for your responses,
    Last edited by Selven; 14th April 2012 at 13:32. Reason: spelling corrections

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Portability of Dynamic / Static version of my own application

    Quote Originally Posted by Selven View Post
    So, what is the directive to add to the $PATH, in order that linux searches in the current directory ?
    You can't fix that with $PATH, it's not Windows. You can use $LD_LIBRARY_PATH instead or just make your app LSB compliant so that it can run on any LSB system (like most Linux distros today).

    For graphical issue:
    If i understand, you recommend to compile only in dynamic ?
    No, that's not what I meant. I meant that when you build your app statically, you need to do some extra steps to make things work. However nowadays it's hard to find a Linux system without Qt installed so it might be easiest to just build dynamically and ask your users to install Qt using their distro's package manager.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 29th March 2012, 19:56
  2. Static and Dynamic Libraries
    By waynew in forum Newbie
    Replies: 29
    Last Post: 1st December 2010, 02:29
  3. Static or Dynamic !!
    By salmanmanekia in forum Newbie
    Replies: 7
    Last Post: 5th June 2010, 15:24
  4. Static vs. Dynamic
    By hosseinyounesi in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2009, 11:21
  5. Replies: 2
    Last Post: 1st August 2007, 15:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.