This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
help linking my own library
- From: Gerald Iakobinyi Pich <nutrina9 at yahoo dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 5 Jul 2004 13:16:35 +0200 (CEST)
- Subject: 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