Re: Building portable applications
- From: Mihai Osian <zzz@xxxxxxx>
- Date: Wed, 20 Sep 2006 14:46:22 +0200
hermbagger@xxxxxxxxx wrote:
Hello Everyone!
I wrote a small program in C++ using the KDE programming environment on
Linux. It's really an amazing environment and makes life easy. The
only problem is, that when I try to run the application on a different
linux machine, I get an error that some libraries are missing.
How do I build my project in the KDE environment to include all the
necessary libraries in the executable?? I cannot see where to do that!
I want to be able to just take the executable that is produced one one
machine and run it on another.
Thanks!!
Herm
Hi Herm,
If you want it that simple, you should link your application statically (google for "static linking"). You should also read about the advantages/disadvantages of static versus dynamic linking.
If - after reading tutorials for half an hour - you decide you want dynamic linking (the better way), you may decide to distribute your application as:
a) a .tar.gz (aka tarball) - an archive with the source code, or
b) a "package" for whatever distribution you use (.rpm/.deb/...)
In the first case, the user would download the source code, run the "configure" script (<== read about "autotools") which tries to find all the required libraries, then run "make" and he would get a working binary for his machine.
In the second case you must define all the libraries/dependencies of your application, then build the binary package in a distribution-specific manner. This is much more simple for the user - he may use his package management system to install your application, and will have all the required libraries automatically installed. Of course, building the binary package requires some effort from you. You may google for "build deb package" in case of Debian-based distributions (replace "deb" with "rpm" for other distributions). Helpful link: http://en.wikipedia.org/wiki/Package_management_system
Mihai
.
- References:
- Building portable applications
- From: hermbagger
- Building portable applications
- Prev by Date: Building portable applications
- Next by Date: freezing at startup
- Previous by thread: Building portable applications
- Next by thread: Re: Building portable applications
- Index(es):
Relevant Pages
|