LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 11-01-2005, 11:30 AM   #1
davidkline
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, 01:08 PM   #2
GrueMaster
Member
 
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:

Quote:
#!/bin/sh
cd /usr/local/games/nwn
# This script runs Neverwinter Nights from the current directory

export SDL_MOUSE_RELATIVE=0
export SDL_VIDEO_X11_DGAMOUSE=0

# 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=./nwmovies.so

./nwmain $@
Either method will work.
 
  


Reply


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 07:56 AM
having problems installing libraries into system.. holetholet Linux - Software 1 11-22-2005 10:57 AM
Making a wine application run deamonized? jon_k Linux - Software 1 06-01-2005 04:57 AM
Will more shared libraries slow down my system? Yalla-One Slackware 5 04-20-2005 03:01 PM
Making static symbols private/local in shared libraries skoona Programming 1 02-18-2005 03:14 PM


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

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