[Gdal-dev] Any possibility of static compile?

Eric Dönges eric.doenges at gmx.net
Tue Dec 5 02:00:17 EST 2006


Am 04.12.2006 um 20:47 schrieb Curt, WE7U:

> What I'm worried about w.r.t. the shared libraries is that I'd have
> to package them along with the app in the /opt/lsb-xastir/lib/
> directory, but I'm not sure whether those libs or the system libs
> would get dynamically linked on startup.  Then again, LSB uses it's
> own loader, so maybe I'm safe there and they've taken care of it for
> me.

You can force Linux to prefer your libraries in /opt/lsb-xastir/lib by
setting LD_LIBRARY_PATH before starting the application. The best way  
to do this (IMO)
would be to have the application started by a shell script that does  
this.

I believe another way would be to use the -rpath option of the linker  
(note that
I have never tried this myself, so I can't say if it will really work  
as expected)
to tell the linker explicitly where to find the libraries. However,  
using hardcoded
library paths in the binary is sure to break if any of your users  
decide they really
need to install the application to some other place, so I would  
recommend using the
LD_LIBRARY_PATH approach.

With kind regards,
Eric



More information about the Gdal-dev mailing list