Results 1 to 4 of 4

Thread: Qt libs static and dynamic

  1. #1
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    4

    Default Qt libs static and dynamic

    Hello!
    Is there any possibility to have static and dyamic versions of qt libs? I unpacked qt sources to 2 different folders (windows) and then in one configure -static and in the other configure -shared. Is it good way? Is there any better way?
    And how can I choose if now I want use static or shared version? What about system variables? Please help.

  2. #2
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    4

    Default Re: Qt libs static and dynamic

    Ok. Now I know that I have to do "configure -static -shared", but how can I choose if now I want to use static or shared version?

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt libs static and dynamic

    I have both on my Mac, and I use a shell script to switch between them.

  4. #4
    Join Date
    May 2006
    Location
    Leeds, West Yorkshire, UK.
    Posts
    17
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt libs static and dynamic

    Morning Conexion2000,

    Quote Originally Posted by conexion2000
    Hello!
    Is there any possibility to have static and dyamic versions of qt libs? I unpacked qt sources to 2 different folders (windows) and then in one configure -static and in the other configure -shared. Is it good way? Is there any better way?
    And how can I choose if now I want use static or shared version? What about system variables? Please help.
    I've installed 4.1.3 with the mingw compiler on Windows. This puts in a shared library system for QT. I then edited the file %QTDIR%\bin\qtvars.bat to see what they do when building debug libraries and simply ran those commands with the -static option to configure (without the debug) as follows :

    cd %QTDIR%
    configure -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg -static
    cd %QTDIR%\src
    mingw32-make release

    I now have a shared and static version of the libraries for QT413.

    In a project file for an app that needs static linking I simply put :

    QMAKE_LFLAGS += -static

    which works fine for me using mingw, or under GCC on Linux. When I build a project I run qmake as normal (once) then make debug or make release as required.

    HTH


    Cheers,
    Norman.

Similar Threads

  1. Generating a static and dynamic library
    By elcuco in forum Qt Programming
    Replies: 3
    Last Post: 20th August 2011, 11:46
  2. static & dynamic linking
    By mickey in forum General Programming
    Replies: 6
    Last Post: 11th June 2010, 08:57
  3. Static vs. Dynamic Building for GPL Open Source Software Release
    By brent99 in forum Installation and Deployment
    Replies: 6
    Last Post: 11th March 2008, 20:46
  4. having both static and dynamic libraries?
    By gfunk in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2007, 07:33
  5. Switching static to dynamic ui loading
    By s_a_white in forum Newbie
    Replies: 4
    Last Post: 26th June 2006, 15:57

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.