Results 1 to 12 of 12

Thread: Static Compile [Qt4]

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Posts
    90
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6
    Thanked 4 Times in 2 Posts

    Default Re: Static Compile [Qt4]

    I finally got it to work. It appears that there is an issue with Qt 4.1 when it comes to compiling with static libraries. If there are shared libraries in the same directory as the static libs... it will always link with the shared libs. At least that is the conclusion I came to trying to get this bastard to link correctly. I tried passing "-static" in the Makefile which should have worked... but I recieved a MOC error about that argument. Adding the "CONFIG += static" in my .pro file did not have any effect. DQT_NO_DEBUG also had no effect... because the shared libraries where debug libraries. I also noticed that when I was setup for shared libraries it sets a few things in the Makefile that resemble that type of linking. When I built the static version those items where missing... which is a good thing. It didn't seem to matter however since it still linked with the shared libs anyways.

    So, sorry for the rant... but if you ever have any problems like I had... you might try the method above. I hope that it is easier to switch between static and shared builds in future releases.

    I also wonder how difficult it would be to create a purely statically linked application under Qt. I am going to pass this thing in binary form to bunch of different linux systems... some old, some new, some Redhat, some Suse... etc. I don't think the shared objects I am linking against will be there. Am I suppose to include these Shared Objects in commercial software?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Static Compile [Qt4]

    Quote Originally Posted by bpetty
    I am going to pass this thing in binary form to bunch of different linux systems... some old, some new, some Redhat, some Suse... etc. I don't think the shared objects I am linking against will be there. Am I suppose to include these Shared Objects in commercial software?
    It won't work for the old ones, but anyway you might find these interesting:

    http://blogs.qtdeveloper.net/archive...ries-on-linux/
    http://blogs.qtdeveloper.net/archive...ions-on-linux/

  3. The following user says thank you to jacek for this useful post:

    bpetty (1st September 2006)

  4. #3
    Join Date
    Aug 2006
    Posts
    90
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6
    Thanked 4 Times in 2 Posts

    Default Re: Static Compile [Qt4]

    Thanks for those links Jacek.

    It will be interesting to see how this plays out. The software I am developing is going to be running on Linux, AIX, Sun OS, and HP Unix.... and Windows. While the LSB trick may work under Linux... I am interested to see how it will play out with the other Unix flavors. I'll talk to Troll Tech about it... and ask our Unix Guru here at work. If I find anything interesting I will post it here incase anyone is interested.

Similar Threads

  1. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  2. Replies: 16
    Last Post: 23rd May 2008, 10:12
  3. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  4. Static compile with jpg support
    By ksqt in forum Newbie
    Replies: 18
    Last Post: 11th May 2007, 04:43
  5. static compile in qt4 with VisualStudio2003
    By iGoo in forum Installation and Deployment
    Replies: 1
    Last Post: 21st July 2006, 08:46

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.