PDA

View Full Version : Static linking in Linux



anupamgee
26th May 2009, 13:16
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

PaceyIV
2nd June 2009, 13:44
Read this http://www.qtcentre.org/forum/f-qt-programming-2/t-qt-45-and-above-license-issue-21428.html

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

Lykurg
2nd June 2009, 15:14
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 (http://wiki.qtcentre.org/index.php?title=Building_static_applications)

PaceyIV
2nd June 2009, 15:30
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?

Lykurg
2nd June 2009, 15:34
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.


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.