LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-09-2010, 04:00 AM   #1
narendra1310
Member
 
Registered: May 2008
Posts: 41

Rep: Reputation: 15
Thumbs up How to set runtime library path in Makefile ????


Hi all,

I would like to set run time library path in my makefile, so that my exe should search run time libraries in that path when executed.

How to set this in makefile?

Thanks in advance
 
Old 06-09-2010, 04:16 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Assuming you use gcc, you should use the -L option to set the path to linked libraries.
At run time, you can use the LD_LIBRARY_PATH environment variable to tell ld where to find its dynamically linked libraries.

Last edited by Agrouf; 06-09-2010 at 04:17 AM.
 
Old 06-09-2010, 04:42 AM   #3
narendra1310
Member
 
Registered: May 2008
Posts: 41

Original Poster
Rep: Reputation: 15
Please can you explain with an example by a simple Makefile
 
Old 06-09-2010, 04:45 AM   #4
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
VERY simple makefile:
Code:
all: target
target: source.c
	gcc -L/my/libraries/are/there -lmylibrary source.c -o target

Last edited by Agrouf; 06-09-2010 at 04:51 AM.
 
  


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
Plz Help me to find GNU C++ Runtime Library smartgupta Linux - Software 1 09-22-2008 10:32 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM
C++ runtime library compatibility with Redhat libraries srinatar SUSE / openSUSE 2 01-30-2005 12:47 AM
Runtime problem with library paths v8dave Slackware 0 12-30-2004 07:45 PM
Error when trying to install java runtime library downinthemine Linux - Newbie 5 07-31-2003 03:49 AM


All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration