Hi josch,

> $ gcc -I/usr/include/freetype2 -I/usr/include/libpng16 -lmupdf -ljbig2dec 
> -ljpeg -lz -lm -lfreetype -lpng16 -lm -lz -lm -lz test.c
> /usr/bin/ld: /tmp/ccCPwEIx.o: in function `main':
> test.c:(.text+0x26): undefined reference to `fz_new_context_imp'
> collect2: error: ld returned 1 exit status

When you put the libraries at the end (after the input file), it will proceed 
further:

> $ gcc -I/usr/include/freetype2 -I/usr/include/libpng16 test.c -lmupdf 
> -ljbig2dec -ljpeg -lz -lm -lfreetype -lpng16 -lm -lz -lm -lz
> /usr/bin/ld: 
> /usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/libmupdf.a(load-jpx.o): in 
> function `jpx_read_image':
> (.text.jpx_read_image+0x79): undefined reference to 
> `opj_set_default_decoder_parameters'
> /usr/bin/ld: (.text.jpx_read_image+0x95): undefined reference to 
> `opj_create_decompress'
> /usr/bin/ld: (.text.jpx_read_image+0xaf): undefined reference to 
> `opj_set_info_handler'
> /usr/bin/ld: (.text.jpx_read_image+0xc1): undefined reference to 
> `opj_set_warning_handler'

But then it is really missing the opj/openjpeg symbols, so -lopenjpeg is
actually required.
openjpeg has been removed from Debian in 2016, as there is now
openjpeg2 (-lopenjp2). After linking with openjpeg2 there are one
undefined js_* symbols remaining, which seems to be coming from mupdf
itself (according to codesearch.d.n).

Regards,
  Reiner

Attachment: signature.asc
Description: PGP signature

Reply via email to