Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-01-2005, 12:30 PM   #1
LQ Newbie
Registered: Nov 2005
Location: Chiago, IL
Distribution: VectorLinux
Posts: 26

Rep: Reputation: 15
Making an application against different system libraries

Hello, I'm new to Linux development and have a question about building an application on one machine that is intended to run on another.

I would like to build an application that uses a set of system libraries that are in a directory other than /lib or /usr/lib. It's similar to a cross compiling mechanism, except both host and target are linux machines (x86) with different versions of Linux. I did try and set the environment variable LD_LIBRARY_PATH in one of the configuration files, but I don't think it worked because when I used ldd on the image, the system files that displayed were from /usr/lib and /lib and not from the paths I specified in LD_LIBRARY_PATH. Preferably, I would like to change this during the invocation of make. What would you suggest?

Please advise, thank you in advance, any help is appreciated,
Old 11-01-2005, 02:08 PM   #2
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
If you really need an application to use a specific set of libraries instead of the shared libraries on a different system, you should either build the application with static libraries, or store the libraries with the program and launch it with a shell wrapper script. Here's an example of how Neverwinter Nights runs on Linux with their own copy of SDL:

cd /usr/local/games/nwn
# This script runs Neverwinter Nights from the current directory


# If you do not wish to use the SDL library included in the package, remove
# ./lib from LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH
export LD_PRELOAD=./

./nwmain $@
Either method will work.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Application similiar to ksnapshot (making screenshots) krajzega Linux - Software 18 09-19-2009 08:56 AM
having problems installing libraries into system.. holetholet Linux - Software 1 11-22-2005 11:57 AM
Making a wine application run deamonized? jon_k Linux - Software 1 06-01-2005 05:57 AM
Will more shared libraries slow down my system? Yalla-One Slackware 5 04-20-2005 04:01 PM
Making static symbols private/local in shared libraries skoona Programming 1 02-18-2005 04:14 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration