Results 1 to 3 of 3

Thread: Building qt program with static library

  1. #1
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Building qt program with static library

    Hello all,

    I'm trying to build a program under linux with a static library (so that you can run the qt app on another machine, where the qt toolkit isn't installed).

    I don't know how qt was installed on the linux box...if the libraries compiled are static or not.....I also don't know if this affects whether or not you can then build a qt app with static libs?

    The only thing I can think of is in my .pro file I should add: CONFIG += staticlib ...etc.

    Anything else I need to know?

    Thanks!

    Jonathan

  2. #2
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Building qt program with static library

    just added template = lib to the .pro file too, but that doesn't help either

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

    Default Re: Building qt program with static library

    Quote Originally Posted by JonathanForQT4 View Post
    I don't know how qt was installed on the linux box...if the libraries compiled are static or not.....I also don't know if this affects whether or not you can then build a qt app with static libs?
    You can't build a static application without static libraries.

    Quote Originally Posted by JonathanForQT4 View Post
    The only thing I can think of is in my .pro file I should add: CONFIG += staticlib ...etc.
    You have to add CONFIG += static (staticlib is for libraries).

    Quote Originally Posted by JonathanForQT4 View Post
    just added template = lib to the .pro file too, but that doesn't help either
    TEMPLATE=lib is for libraries, if you want to build an application, use TEMPLATE=app.

    Also read this: http://wiki.qtcentre.org/index.php?t...c_applications

Similar Threads

  1. Wrap a static QT library inside an XPCOM component ?
    By Paul_Xul in forum Qt Programming
    Replies: 2
    Last Post: 3rd August 2010, 08:16
  2. Replies: 16
    Last Post: 23rd May 2008, 11:12
  3. static library archiving question
    By ChasW in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2007, 09:38
  4. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 05:19
  5. Win32 qmake: building a static library
    By Amanda in forum Qt Programming
    Replies: 5
    Last Post: 8th November 2006, 20:32

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.