agl / jbig2enc

JBIG2 Encoder
Other
3 stars 1 forks source link

fixed linking with leptonica 1.69 #27

Closed dnet closed 12 years ago

dnet commented 12 years ago

I had problems like #25, the linker missed symbols both from libgif and libwebp producing output like the following. This commit adds both libraries to the linker, so jbig2 gets compiled.

g++ -o jbig2 jbig2.cc -L. -ljbig2enc /usr/lib/liblept.a -I/usr/include/leptonica/ -Wall -I/usr/include -L/usr/lib -O3  -lpng -ljpeg -ltiff -lm -lz
/usr/lib/liblept.a(webpio.o): In function `pixReadStreamWebP':
(.text+0x42): undefined reference to `WebPGetInfo'
/usr/lib/liblept.a(webpio.o): In function `pixReadStreamWebP':
(.text+0x91): undefined reference to `WebPDecodeRGBAInto'
/usr/lib/liblept.a(webpio.o): In function `readHeaderWebP':
(.text+0x1ef): undefined reference to `WebPGetInfo'
/usr/lib/liblept.a(webpio.o): In function `pixWriteStreamWebP':
(.text+0x367): undefined reference to `WebPEncodeRGBA'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x2b): undefined reference to `DGifOpenFileHandle'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x43): undefined reference to `DGifSlurp'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x1df): undefined reference to `DGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x1ee): undefined reference to `DGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x4a5): undefined reference to `DGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x4f5): undefined reference to `DGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixReadStreamGif':
(.text+0x51a): undefined reference to `DGifCloseFile'
/usr/lib/liblept.a(gifio.o):(.text+0x547): more undefined references to `DGifCloseFile' follow
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x711): undefined reference to `MakeMapObject'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x7a5): undefined reference to `EGifOpenFileHandle'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x7e0): undefined reference to `EGifPutScreenDesc'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x7f7): undefined reference to `FreeMapObject'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x7ff): undefined reference to `EGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x83e): undefined reference to `FreeMapObject'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x86c): undefined reference to `FreeMapObject'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x88c): undefined reference to `EGifPutImageDesc'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0x8a7): undefined reference to `EGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xa57): undefined reference to `EGifPutLine'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xa8c): undefined reference to `EGifPutComment'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xaba): undefined reference to `EGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xb1d): undefined reference to `FreeMapObject'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xb73): undefined reference to `EGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xbe2): undefined reference to `EGifCloseFile'
/usr/lib/liblept.a(gifio.o): In function `pixWriteStreamGif':
(.text+0xc0d): undefined reference to `EGifCloseFile'
collect2: ld returned 1 exit status
make: *** [jbig2] Error 1
zdenop commented 12 years ago

IMO it is better to implement autotools instead of manual editing of makefile... I did it here: https://github.com/zdenop/jbig2enc

agl commented 12 years ago

I'd take the .gitignore if it was in its own pull request.

dnet commented 12 years ago

cherry-pick'd for you: #31