Re: Building portable applications



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
.



Relevant Pages

  • Re: Building portable linux applications
    ... I wrote a small program in C++ using the KDE programming environment on ... It's really an amazing environment and makes life easy. ... linux machine, I get an error that some libraries are missing. ...
    (comp.os.linux.development.apps)
  • Bush closes EPA Libraries
    ... The White House has begun closing the Enviromental Protection ... closing most of its research libraries, both to the public and to its own staff. ... Climate change, energy, clean air and water, forest and wildlands ... ages approach to the environment looks like, ...
    (alt.true-crime)
  • One step shy of book-burning, Bush mob closes EPA libraries
    ... guise of fiscal responsibility, the Bush Environmental Protection ... Agency began closing most of its research libraries, ... starved and understaffed agencies like the EPA and the Forest Service. ... ages approach to the environment looks like, ...
    (alt.politics)
  • Re: CL-UNIFICATION as a library (Re: Qi Seems Great)
    ... Server environment. ... complaints, just a feel that it could get better. ... but from seeing PLT Scheme and having in mind that there is a ... there are libraries so proeminent that customers or PHB impose them ...
    (comp.lang.lisp)
  • open ldap build config pthread hang
    ... checking whether build environment is sane... ... checking for executable suffix... ... checking whether the linker supports shared libraries... ...
    (freebsd-current)