Results 1 to 7 of 7

Thread: static & dynamic linking

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: static & dynamic linking

    Some pros and cons have been listed in our wiki: [WIKI]Building static applications[/WIKI].
    J-P Nurmi

  2. #2
    Join Date
    Jun 2010
    Posts
    31
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: static & dynamic linking

    Having static libraries work with qmake seems to require quite a bit of black magic. I've tried getting it working with the prebuilddefs, the postbuild defs, and the createprl methods of having static libraries properly recognize library dependencies during compilation. The only method that I've found that works is tweaking the order in which static libraries are compiled in order to resolve any linking errors.
    I have found that the documentation online is frustratingly sparse and that a lot of the links to documentation are dead. So when trying to decide whether or not to use static or dynamic linking, keep in mind that you will have to deal with a few headaches to get everything linking properly.
    Something that I haven't successfully gotten to work with static linking is the addition of the -( and -) flags that you can add straight to the ld linker. It seems like these flags are not recognized by the LDFLAGS you can place in a .pro file. Also, those flags really add to your compilation time, however when using them you don't have to deal with re-ordering of libraries.

Similar Threads

  1. Static linking of Qt programs
    By divya balachandran in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2008, 12:10
  2. Replies: 16
    Last Post: 23rd May 2008, 10:12
  3. Qt 4.3 static linking on Windows
    By john_crichton in forum Installation and Deployment
    Replies: 2
    Last Post: 13th May 2008, 06:57
  4. Replies: 2
    Last Post: 1st August 2007, 15:04
  5. Replies: 4
    Last Post: 20th February 2006, 09:11

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.