[Gc] Problem when linking..

Boehm, Hans hans.boehm at hp.com
Fri Mar 17 14:46:17 PST 2006


Are you talking about the warning message?
 
That's as expected, and unrelated to the gc.  Libraries should appear
only on the command line used for linking, not those for compiling to .o
files.  Don't include libraries in CFLAGS.
 
Hans


________________________________

	From: gc-bounces at napali.hpl.hp.com
[mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Renaud Dubois
	Sent: Friday, March 17, 2006 1:27 PM
	To: gc at napali.hpl.hp.com
	Subject: [Gc] Problem when linking..
	
	
	Hi,
	
	I have some problems to link my program with gc.$ make
	
	$ make
	gcc -DDEBUG -DGARBAGE_COLLECTOR  -lgc   -c -o module1.o
module1.c
	gcc: -lgc: linker input file unused because linking not done
	gcc -DDEBUG -DGARBAGE_COLLECTOR  -lgc -o module1 module1.o
	
	
	The program is well linked..
	 $ ldd module1
	        linux-gate.so.1 =>  (0xffffe000)
	        libgc.so.1 => /usr/lib/libgc.so.1 (0xb7f28000)
	        libc.so.6 => /lib/tls/libc.so.6 (0xb7e0d000)
	        libdl.so.2 => /lib/libdl.so.2 (0xb7e09000)
	        /lib/ld-linux.so.2 (0xb7f70000)
	
	
	
	The make file:
	
	# FUNCTION:
	# Makefile for module 1
	
	CC=gcc
	
	NAME=module1
	
	OBJS=module1.o
	
	OPTIMIZE= -O2 -march=i486 -mtune=i686 -Wall
	LIBRARY= -lgc
	FLAGS= -DDEBUG -DGARBAGE_COLLECTOR
	
	CFLAGS=  $(FLAGS)  $(LIBRARY)
	
	all: $(NAME)
	
	$(NAME): $(OBJS)
	        $(CC) $(CFLAGS) -o $(NAME) $(OBJS)
	
	$(NAME).o: $(NAME).c
	
	clean:
	        rm -f *.o $(NAME) core *~
	
	I'm using the gc version 6.5 on linux Gentoo 2.6.12-gentoo-r9
and gcc version 3.4.5
	
	Renaud Dubois
	
	
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20060317/9cd66d2e/attachment.htm


More information about the Gc mailing list