PDA

View Full Version : how to create standalone executable file for any ubuntu system



iswaryasenthilkumar
5th May 2015, 14:22
I need a stand alone executable files which can be installed on any Ubuntu system.i already created my QT program.i need to convert this to standalone executable file for ubuntu system.please can any one help me for this:confused:
Thanks in advance:)

jefftee
5th May 2015, 16:37
You will have to build a static version of the Qt libraries and link against the static Qt libraries instead of the dynamic Qt libraries.

Radek
5th May 2015, 16:49
First of all, you need static libraries (not DLLs or so's) for Qt and link your app statically - both for 32-bit and for 64-bit. That's because your target Ubuntu's need not have Qt installed (they can be Gnome-based or use another desktop environment). AFAIK, the static Qt libraries need some license. Even if you can download Qt sources (about 700 MB of code) and compile the static libraries (both 32-bit and 64-bit) yourself, you may not be allowed to distribute your statically linked apps. Also prepare for your apps becoming really huge in size (many MB). Even then I am not sure that your apps will run on any Ubuntu. Ubuntu is a developing OS so that the old APIs need not be compatible with the contemporary ones.

It's a rather "challenging" task.

d_stranz
5th May 2015, 18:43
It's a rather "challenging" task.

Much more challenging than the poster is capable of, if you've read any of the previous threads. The poster isn't even aware of what an executable file is.

iswaryasenthilkumar
6th May 2015, 07:58
yes you are right d_stranz ...but i will not b same lik this..i will improve,,one day am sure i too will be experts in Qt.am a beginner for programming language i will learn to improve my programming knowlegde
Much more challenging than the poster is capable of, if you've read any of the previous threads. The poster isn't even aware of what an executable file is.

d_stranz
6th May 2015, 18:21
but i will not b same lik this...i will learn to improve my programming knowlegde

Yes, I am sure you will, and I hope you have great success. But right now, the job you are trying to do is much, much bigger than your current knowledge. We try to help when we can, but it is very difficult for us because there are so many basic things that you don't know about yet.

You need to find someone at your company or school who can help you with some of the things you are struggling with - someone who can look over your shoulder and see what you are doing - and who can see where you are going wrong.

iswaryasenthilkumar
7th May 2015, 07:03
sorry soon i will improve d_stranz,, i know am in still down each day i will improve soon,Thanx for your guide



Yes, I am sure you will, and I hope you have great success. But right now, the job you are trying to do is much, much bigger than your current knowledge. We try to help when we can, but it is very difficult for us because there are so many basic things that you don't know about yet.

You need to find someone at your company or school who can help you with some of the things you are struggling with - someone who can look over your shoulder and see what you are doing - and who can see where you are going wrong.

simply i created Qt widget now i want to add static libraries to get executable file for ubuntu,,can you please give some examples to add libraries in Qt project and also i have doubt how to find Qt libraries
You will have to build a static version of the Qt libraries and link against the static Qt libraries instead of the dynamic Qt libraries.

yeye_olive
7th May 2015, 10:00
Bundling libraries with an application is discouraged on Ubuntu, not to mention licensing issues. Do you really need a standalone executable or are you just looking for a way to package your application for any Ubuntu system? In the latter case, this kind of problem is solved by the package management system. You need to build a package (.deb file) from your application and declare its dependencies (including the relevant Qt packages).

iswaryasenthilkumar
7th May 2015, 10:55
Yes olive i need a standalone executable file,,because if my friend or client need my project means i want to givce only exe file and also i should not show the code ,i should give only my exe file,thats why i asked i want to create or procedure to do standalone executable file for any ubuntu system
above friends suggested me to create static libraires for qt and to link with my app,,i also did well successfuly
my finame.pro


QT += core gui

TARGET = staticlink
TEMPLATE = app


SOURCES += main.cpp\
widget.cpp

HEADERS += widget.h \
../statLib/statlib.h

FORMS += widget.ui

INCLUDEPATH += "/home/user1/statLib"
LIBS += "/home/user1/statLib-build-desktop-Qt_4_8_1_in_PATH__System__Release/libstatLib.a"


now i got 4 folder myfilename,myfilebuild(release),staicfolder,static build(release),,did i created my standalone executable file,??
Bundling libraries with an application is discouraged on Ubuntu, not to mention licensing issues. Do you really need a standalone executable or are you just looking for a way to package your application for any Ubuntu system? In the latter case, this kind of problem is solved by the package management system. You need to build a package (.deb file) from your application and declare its dependencies (including the relevant Qt packages).

yeye_olive
7th May 2015, 11:21
Do you have a commercial license for Qt? If you do not, then you have been developing your software with the LGPL version, and you are now bound by that license, which limits the ways in which you can distribute your application. If you distribute an executable that was statically linked with Qt, and you do not want to distribute your source code, then you must provide the object files and the Makefile to allow any user to relink your application with another version of Qt. See http://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic.

wysota
7th May 2015, 11:38
because if my friend or client need my project means i want to givce only exe file and also i should not show the code

This doesn't mean you have to make your binary static. You can deploy your executable along all the libraries it requires. Just like pretty much almost anyone else in the world does.