Results 1 to 5 of 5

Thread: Static linking in Linux

  1. #1
    Join Date
    Apr 2009
    Posts
    58
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Static linking in Linux

    hi All ,
    I am using Qt4.5 on Fedora9.I want to statically link any application.I tried "configure -static"
    it asks for license key . I am not able to get it from the download site.What is the Solution?
    thnx

  2. #2
    Join Date
    Mar 2009
    Posts
    98
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Default Re: Static linking in Linux

    Read this http://www.qtcentre.org/forum/f-qt-p...sue-21428.html

    If you haven't got a commercial license of Qt you can't compile your program with a static linking.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Static linking in Linux

    Quote Originally Posted by PaceyIV View Post
    If you haven't got a commercial license of Qt you can't compile your program with a static linking.
    Of course you can! Not under the LGPL, but under the terms of GPL it is still possible:

    lykurg@XXX:/qt/qtsdk-2009.02/qt$ ./configure -static -release -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg
    Which edition of Qt do you want to use ?

    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.

    o


    This is the Qt/X11 Open Source Edition.

    You are licensed to use this software under the terms of
    the GNU General Public License (GPL) versions 3.
    You are also licensed to use this software under the terms of
    the Lesser GNU General Public License (LGPL) versions 2.1.

    Type '3' to view the GNU General Public License version 3.
    Type 'L' to view the Lesser GNU General Public License version 2.1.
    Type 'yes' to accept this license offer.
    Type 'no' to decline this license offer.

    Do you accept the terms of either license? yes

    Creating qmake. Please wait...
    g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -I/qt/qtsdk-2009.02/qt/include -I/qt/qtsdk-2009.02/qt/include/QtCore -I/qt/qtsdk-2009.02/qt/src/corelib/global -I/qt/qtsdk-2009.02/qt/src/script -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/qt/qtsdk-2009.02/qt/mkspecs/linux-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT project.cpp
    Download the sources again, maybe you use "commercial" source?

    Our wiki is also a good place for getting informations: Building static applications

  4. #4
    Join Date
    Mar 2009
    Posts
    98
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Default Re: Static linking in Linux

    Wow! So now I'll try the difference between GPL and LGPL.

    I've got only a question: if on windows I compile my program with static lybrary using QtCreato (ming32-make), I still also need to add the dll of the compiler?

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Static linking in Linux

    Quote Originally Posted by PaceyIV View Post
    Wow! So now I'll try the difference between GPL and LGPL.
    The most evident different is, that you must publish all sources of your program. And it must be runable even without linking to a proprietary/closed library.

    Quote Originally Posted by PaceyIV View Post
    I've got only a question: if on windows I compile my program with static lybrary using QtCreato (ming32-make), I still also need to add the dll of the compiler?
    Yes I think so.

Similar Threads

  1. Static linking of Qt programs
    By divya balachandran in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2008, 13:10
  2. Replies: 16
    Last Post: 23rd May 2008, 11:12
  3. Qt 4.3 static linking on Windows
    By john_crichton in forum Installation and Deployment
    Replies: 2
    Last Post: 13th May 2008, 07:57
  4. static linking issue
    By ashwini in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2006, 13:40
  5. Replies: 4
    Last Post: 20th February 2006, 10: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.