This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

help linking my own library


   Hy!

   I have a problem with a library I wrote. The
library sems to compile just fine, and also linking.
But I get an error when linking it in another program.
   This is how I compiled the library:

LDFLAGS = -O1 -s -shared -lz -ljpeg -lpng -lungif
-ltiff

all: liballa

clean: 
	rm *.o

liballa: $(OBJ)
	g++ -L /usr/local/lib $(LDFLAGS) -o liballa.so $(OBJ)

#< following the compilation of all cpp files>
.....


The problem is that when usimg this libray in another
program (test program) I get a undefined reference
error:

../bsd/liballa.so: undefined reference to
`pdfx::PNGImage::PNGImage(....

This is how I compiled my test program:

all: test_bsd

clean:
	rm *.o	
	rm test_bsd

test_bsd: test.o
	g++ -L ../bsd -O1 -lalla test.o -o test_bsd

test.o: test.cpp
	g++ -c test.cpp


Could somebody please tell me what I did wrong ?

Thanks.




	

	
		
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]