Index: [thread] [date] [subject] [author]
  From: Matthew Todd <mt@perelandra.dorm.duke.edu>
  To  : 
  Date: Wed, 03 Mar 1999 01:03:53 +0000

lucky library linking

hey, everyone!

i had a rough trial-and-error time setting up our Makefile to
link an executable with libraries in a different directory.  i'm
not sure if the following is a clean solution or not, but it
works, so i thought i'd spare you all the headache:

suppose your directory with library files is stored in some
variable called MY_LIBS.  be sure that LD_FLAGS includes both
-L$(MY_LIBS) *and* -R$(MY_LIBS), as follows:

LD_FLAGS	= -L. -L$(MY_LIBS) -R$(LIB_DIR) -R$(MY_LIBS)


the man page for g++ doesn't have any information on -R, so i'm
not quite sure what it's doing there.  (ie. why does the generic
Makefile use -R for the LIB_DIR (= /afs/acpub/project/cps/lib)
instead of -L?)


happy coding,
matthew


Index: [thread] [date] [subject] [author]