How to create package for a Qt4 application in linux..?
Hi guys,
i am trying to create package for my Qt4 application which is developed and to be run on Linux ( Ubuntu or Opensuse 10.2 ). I have a software called "Install Anywhere x.x" for packaging , so please tell me what are all the Qt4 dependent files ( in LINUX ) i have to supply with my executable , so that my client need not to install Qt4 in his machine.
So please list out the Qt4 dependent files (in Opensuse 10.2 ) ,and from which folder i will get these dependent files...
Thanks in advance
Re: How to create package for a Qt4 application in linux..?
I suggest you compile your application in static mode and forget about dependencies. Otherwise you'll have to deliver half of the system if you want to cover all possibilities. If you want a shared compilation, I suggest you assume Qt4 is already installed on that machine (Qt4 is an optional module of Linux Standard Base, so it should be there) and simply deploy your application files only.
How to create package for a Qt4 application in linux..?
We do not want to statically link the module because of performance issues.
To consider shared compilation ,the client machine does not have Qt4 installed,so that is the reason we want to set up a package.
Do let us know all the dependent dlls and files that we need to include in our package so that our QT4 application runs on Opensuse 10.2 machine.
Thank You.
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
archanasubodh
We do not want to statically link the module because of performance issues.
Performance issues? Static applications are faster than shared ones because there is no dynamic linking stage when the application is executed. The only penalty is a bigger memory footprint.
Quote:
Do let us know all the dependent dlls and files that we need to include in our package so that our QT4 application runs on Opensuse 10.2 machine.
Compile the application and run ldd on the resulting binary and you'll get your dependency list. Then you have to decide which libraries to assume "always present", such as glibc. Others you have to ship yourself in appropriate versions.
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
wysota
I suggest you compile your application in static mode and forget about dependencies. Otherwise you'll have to deliver half of the system if you want to cover all possibilities. If you want a shared compilation, I suggest you assume Qt4 is already installed on that machine (Qt4 is an optional module of Linux Standard Base, so it should be there) and simply deploy your application files only.
Could you please tell me how to compile the application in STATIC MODE .I am working in Kdevelop ( IDE in Linux ). Which option i need to select to get it compiled in STATIC MODE..?
thanks in advance
Re: How to create package for a Qt4 application in linux..?
Offtopic: You have posted this in the wrong section !!
And here is what you asked for( already in our wiki ) http://wiki.qtcentre.org/index.php?t...c_applications
Re: How to create package for a Qt4 application in linux..?
I did build Qt4.3.4 as per the insturctions in the site ...
http://wiki.qtcentre.org/index.php?t...c_applications
what i did ...
=> downloaded the Qt4.3.4 soure code ( for Linux )from Trolltech site
=> created a seperated directory for like this in my home directory
Qt-4.3.4_Static
=> typed the following commands
1) cd Qt-4.3.4_Static [ for switching to Qt-4.3.4_Static ]
2) ./configure -static -release -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg
3) make sub-src
4) su
5) make install_qmake
6) make install_mkspecs
Now system created directory - "Trolltech/Qt-4.3.4/" - inside /usr/local .
Now i want to set the PATH variable like this in /etc/profile ..
Code:
PATH = "/home/myname/Qt-4.3.4_Static/bin: $PATH"
....is it ok ...??
My doubt is if in future if i want to use shared library of Qt4 ( which was default in Opensuse ) ,which is the path i need to update in the PATH variable ...?? ( because the default path of the default version of Qt4 in Opensuse is /usr/lib/qt4 ,and there is NO bin folder inside this qt4 )
Please tell me how to switch to "Shared Qt4 Library" and "Static Qt4 Library" ...??
Thanks in advance
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
joseph
Please tell me how to switch to "Shared Qt4 Library" and "Static Qt4 Library" ...??
Just make sure the set of libraries (and tools) of your choice is earlier in the PATH (or library path). By manipulating the path you decide which set of libs will be used for compilation.
Re: How to create package for a Qt4 application in linux..?
I have build Qt4.3.4 version statically using the instuctions given in wiki
Here is the my Qt static diectory
Code:
/home/myname/qt4.3.4_Static
Inside this folder i can see the following sub folders
Code:
1) bin ==> contains qmake , rcc , findtr, uic ,uic3...etc
2) lib ==> conatins so many *.so files
At present my PATH varibale contains the the following ( ie; the result of "echo $PATH" )
Code:
/usr/local/bin
:/usr/bin
:/usr/X11R6/bin
:/bin
:/usr/games
:/opt/gnome/bin
:/opt/kde3/bin
:/usr/lib/jvm/jre/bin
:/usr/lib/mit/bin
:/usr/lib/mit/sbin
:/usr/lib/qt3/binv
i have 2 options in my mind as follwing ...
Code:
1) export PATH = " /home/myname/qt4.3.4_Static/bin :$PATH"
or
2) export PATH = " /home/myname/qt4.3.4_Static/lib :$PATH"
so please tell me tell me which option i have to add in the PATH variable to get a static application liked with the static qt4.3.4 library ...
please help me..!!!!
Re: How to create package for a Qt4 application in linux..?
The one containing bin. BTW. You could have tried both yourself instead of asking this here.
Re: How to create package for a Qt4 application in linux..?
I set the PATH variable to...
Code:
export PATH="/home/myname/Qt4.3.4_Static/bin:$path"
Then compiled the my application after editing the *.pro file like this
Then i checked the dependency files of EXE using command
Code:
ldd myexecutablefile
I got a list of files as follows ,which is same when i buid my application in dynamic mode ( ie; no CONFIG += static in pro file )
Code:
linux-gate.so.1 => (0xffffe000)
libQt3Support.so.4 => /usr/lib/libQt3Support.so.4 (0xb7c28000)
libQtSql.so.4 => /usr/lib/libQtSql.so.4 (0xb7bf1000)
libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0xb7bad000)
libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0xb7b53000)
libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0xb7480000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb745c000)
libSM.so.6 => /usr/lib/libSM.so.6 (0xb7452000)
libICE.so.6 => /usr/lib/libICE.so.6 (0xb7439000)
libXi.so.6 => /usr/lib/libXi.so.6 (0xb7430000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb7427000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xb7421000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb741b000)
libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0xb7411000)
libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0xb740d000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb73a1000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7375000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb7366000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb7249000)
libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0xb70cb000)
libz.so.1 => /lib/libz.so.1 (0xb70b8000)
libdl.so.2 => /lib/libdl.so.2 (0xb70b4000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb709b000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6fb7000)
libm.so.6 => /lib/libm.so.6 (0xb6f91000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6f85000)
libc.so.6 => /lib/libc.so.6 (0xb6e57000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6e50000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb6e4c000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb6e2b000)
/lib/ld-linux.so.2 (0xb7f3d000)
One more thing is, the size of the executable-file is not increased after building it in static mode. It's only 23.9 MB , previously(dynamic mode) it was 29.4 MB
But how can i confirm that my application got generated succussfully in STATIC mode ...?
Re: How to create package for a Qt4 application in linux..?
29MB executable build in dynamic mode? I think that's with debugging turned on, isn't it?
By the way - the ldd above states Qt is linked in dynamic mode :)
Re: How to create package for a Qt4 application in linux..?
What's the point of make installing qmake and mkspecs only?
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
jpn
What's the point of make installing qmake and mkspecs only?
i did the following to build Qt4.3.4 in staic mode ( as per the instructions in site
Code:
./configure -static -release -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg
su
make install_qmake
make install_mkspecs
make sub-src-install_subtargets ====> here i was getting some error message
Now what happening is . i was trying to compile my application from consile i did the following commands in terminal
Code:
=> which uic
home/myname/qt4.3.4_Staic/bin/uic
=> which make
/usr/bin/make
=> which qmake
home/myname/qt4.3.4_Staic/bin/qmake
Then i changed directory to my application ( say "My_App_Dir" ) and typed the comamnds
Code:
> qmake myFile.pro
> make clean
> make ==============> here am gettin errors like
/usr/local/Trolltech/Qt-4.3.4/bin/uic dlg/SynsupMailDlg.ui -o ../source/dlg/ui_SynsupMailDlg.h
make: /usr/local/Trolltech/Qt-4.3.4/bin/uic: Command not found
make: *** [../source/dlg/ui_SynsupMailDlg.h] Error 127
why it is taking the uic from "/usr/local/Trolltech/Qt-4.3.4/bin/uic" ...?
Please help to solve this ...
Re: How to create package for a Qt4 application in linux..?
What kind of errors were you getting?
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
wysota
What kind of errors were you getting?
if you are aking the errors i got in
Code:
make sub-src-install_subtargets
sorry i don't remember . Please tell me how to uninstall this qt_4.3.4_Static verion from my machine atleast.
I will rebuild Qt4 static version one more time ,and i will let you know what was the error.
Thanks in advance
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
joseph
Please tell me how to uninstall this qt_4.3.4_Static verion from my machine atleast.
Delete the directory containing the installation.
Re: How to create package for a Qt4 application in linux..?
I am rebuilding Qt4.3.4 in STATIC mode , and type the command in my static directory called qt4.3.4_Static.
Code:
./configure -static -release -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg
Now i am getting the following message
Code:
Qt is now configured for building. Just run 'gmake'.
Once everything is built, you must run 'gmake install'.
Qt will be installed into /usr/local/Trolltech/Qt-4.3.4
To reconfigure, run 'gmake confclean' and 'configure'.
I don't know what i have to do next, either "gmake" or "make sub-src" ( as per the wiki.qtcentre.org ).
So can you people guid me to the right path ...?
Re: How to create package for a Qt4 application in linux..?
gmake = GNU make, just invoke the command which is proposed.
Compiling sub-src target is advised because (as it says on wiki):
Quote:
If you only type make (without the sub-src) then all examples and all demos will be build. With static libs this takes very much space (A test got about 3.8GiB big and it wasn't finished yet.), so I really don't recommend that way.
Re: How to create package for a Qt4 application in linux..?
Quote:
Originally Posted by
jpn
gmake = GNU make, just invoke the command which is proposed.
Compiling sub-src target is advised because (as it says on wiki):
After the following command ....
Code:
/configure -static -release -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg
I can see a new folder "Trolltech" got created in the following way...
Code:
/usr/local/Trolltech ===========> Here also one "bin" folder is there .So should i update this bin folder in PATH variable ....?
The next step i did was..............
Code:
make sub-src
su
make install_qmake
**********message after this is ***********
install -m 755 -p /home/myname/qt4.3.4_Static/bin/qmake /usr/local/Trolltech/Qt-4.3.4/bin/
strip /usr/local/Trolltech/Qt-4.3.4/bin/qmake
Next step ....
Code:
make install_mkspecs
**********message after this is ***********
rm -f /usr/local/Trolltech/Qt-4.3.4/mkspecs/default; ln -sf linux-g++ /usr/local/Trolltech/Qt-4.3.4/mkspecs/default
install -m 644 -p /home/myname/qt4.3.4_Static/mkspecs/qconfig.pri /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/aix-g++ /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/aix-g++-64 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/aix-xlc /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/freebsd-g++ /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/freebsd-g++34 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/hpux-acc /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/hpux-acc-64 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/hpux-g++-64 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/hpuxi-acc-32 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/hpuxi-acc-64 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/hurd-g++ /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/linux-cxx /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/linux-ecc-64 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/linux-icc /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/linux-icc-32 usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/win32-msvc.net /usr/local/Trolltech/Qt-4.3.4/mkspecs/
cp -f -r /home/myname/qt4.3.4_Static/mkspecs/win32-msvc2005 /usr/local/Trolltech/Qt-4.3.4/mkspecs/
Next step is ....
Code:
make sub-src-install_subtargets
**********message after this is ***********
make: *** No rule to make target `sub-src-install_subtargets'. Stop. =====>> How can i solve this error ....?
Please help me ..!!!!
Thanks for all your support