[Barcode] Barcode library and C++

Dani Pardo dani@minerva.enpl.es
Thu, 14 Sep 2000 11:27:47 +0100 (WET DST)


 Hi list,

 I'm trying to write a Qt/KDE class/widget in C++ to draw barcodes. The
problem is that I can't get the thing to link with barcode-0.94:

 $ g++ program.cc -I/usr/local/qt/include -L/usr/local/qt/lib -lqt
-lbarcode 

 /tmp/ccWQCkgJ.o(.text+0x80): undefined reference to 
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'

 
 ... Trying to figure what the problem was.. I got the sample.c that comes
with libbarcode and tried this:

calix:~/barcode-0.94$ gcc --version
egcs-2.91.66
calix:~/barcode-0.94$ gcc sample.c -lbarcode -L.
calix:~/barcode-0.94$ cp sample.c sample.cpp
calix:~/barcode-0.94$ gcc sample.cpp -lbarcode -L.
/tmp/cc2HKR79.o: In function `main':
/tmp/cc2HKR79.o(.text+0x5d): undefined reference to
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'
/tmp/cc2HKR79.o(.text+0x80): undefined reference to
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'
/tmp/cc2HKR79.o(.text+0xa3): undefined reference to
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'
/tmp/cc2HKR79.o(.text+0xc9): undefined reference to
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'
/tmp/cc2HKR79.o(.text+0xf2): undefined reference to
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'
/tmp/cc2HKR79.o(.text+0x115): more undefined references to
`Barcode_Encode_and_Print(char *, _IO_FILE *, int, int, int, int, int)'
follow
collect2: ld returned 1 exit status

... GCC says it won't compile it, and I've only changed the name of the
source file..?
    Any suggestion/comment about using libbarcode under C++?

   Thanks in advance,

---
Dani Pardo, dani@enpl.es
Enplater S.A