Hi de2Zotjes,
Thanks a lot for your reply.
May you give me more details about what you mentioned about. If you can give me an example, that will be very helpful for me.
Thanks,
Rfr1tz
Main Topics
Browse All TopicsHi,
I'm working on a program that has a Makefile that contains the following section:
//------------
# Make command to use for dependencies
MAKE=gmake
# If no configuration is specified, "Debug" will be used
ifndef "CFG"
CFG=Debug
endif
#
# Configuration: Debug
#
ifeq "$(CFG)" "Debug"
OUTDIR=Debug
OUTFILE=$(OUTDIR)/Masteste
CFG_INC=-I../../../Code/..
-I../../../Code/.../includ
-I../../../Code/.../includ
-I../../../Code/.../includ
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/file1
$(OUTDIR)/file3.o /* And a lot more */
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
COMPILE=g++ -c -x c++ -O0 -g -o "$(OUTDIR)/$(*F).o" $(CFG_INC) "$<" -DLINUX -DPOSIX -pthread
LINK=g++ -O0 -g -o "$(OUTFILE)" $(OBJ) $(CFG_LIB)
//--------------
This program needs 4 static libraries, say x1.a, x2.a, x3.a, x4.a
I've tried to update this Makefile to add these libraries but it doesn't work (the linker does not see the libraries)
I've tried many ways, one of them is:
//--------------
CFG_LIB= -L/home/.../libdir -lx1, -lx2, -lx3, -lx4
(all the libraries, i.e. x#.a, are physically stored in /home/.../libdir
//--------------
but none of them seems to work.
If you know how update this Makefile to make the linker (g++) see these libraries during the linking, please help.
Thanks a lot,
Rfr1tz
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: de2ZotjesPosted on 2004-07-20 at 14:04:52ID: 11597498
If I take a quick look at the g++ compiler you need to "wrap" the options for the linker :
-Wl,<options> Pass comma-separated <options> on to the linker
so your CFG_LIB should be preceded by a -Wl,