With the latest openjpeg, the build fails in this way (at the end of the final link: build/debug/fitz/tempfile.o: In function `fz_tempfilename': tempfile.c:(.text+0x77): warning: the use of `tempnam' is dangerous, better use `mkstemp' build/debug/fitz/load-jpx.o: In function `fz_load_jpx': load-jpx.c:(.text+0x132): undefined reference to `opj_set_default_decoder_parameters' load-jpx.c:(.text+0x146): undefined reference to `opj_create_decompress' load-jpx.c:(.text+0x160): undefined reference to `opj_set_info_handler' load-jpx.c:(.text+0x172): undefined reference to `opj_set_warning_handler' load-jpx.c:(.text+0x184): undefined reference to `opj_set_error_handler' load-jpx.c:(.text+0x191): undefined reference to `opj_setup_decoder' load-jpx.c:(.text+0x1a3): undefined reference to `opj_stream_default_create' load-jpx.c:(.text+0x1c7): undefined reference to `opj_stream_set_read_function' load-jpx.c:(.text+0x1d6): undefined reference to `opj_stream_set_skip_function' load-jpx.c:(.text+0x1e5): undefined reference to `opj_stream_set_seek_function' load-jpx.c:(.text+0x1f4): undefined reference to `opj_stream_set_user_data' load-jpx.c:(.text+0x1ff): undefined reference to `opj_stream_set_user_data_length' load-jpx.c:(.text+0x20f): undefined reference to `opj_read_header' load-jpx.c:(.text+0x227): undefined reference to `opj_decode' load-jpx.c:(.text+0x237): undefined reference to `opj_stream_destroy' load-jpx.c:(.text+0x23f): undefined reference to `opj_destroy_codec' load-jpx.c:(.text+0x4e0): undefined reference to `opj_image_destroy' load-jpx.c:(.text+0x636): undefined reference to `opj_image_destroy' load-jpx.c:(.text+0x64e): undefined reference to `opj_stream_destroy' load-jpx.c:(.text+0x656): undefined reference to `opj_destroy_codec' load-jpx.c:(.text+0x660): undefined reference to `opj_image_destroy' load-jpx.c:(.text+0x6a4): undefined reference to `opj_image_destroy' load-jpx.c:(.text+0x6c4): undefined reference to `opj_destroy_codec' load-jpx.c:(.text+0x6e4): undefined reference to `opj_stream_destroy' load-jpx.c:(.text+0x6ec): undefined reference to `opj_destroy_codec' load-jpx.c:(.text+0x71f): undefined reference to `opj_image_destroy' load-jpx.c:(.text+0x73c): undefined reference to `opj_image_destroy' load-jpx.c:(.text+0x759): undefined reference to `opj_image_destroy' /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: build/debug/libmupdf.so.1.9: hidden symbol `opj_stream_destroy' isn't defined /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status Makefile:398: recipe for target 'build/debug/libmupdf.so.1.9' failed make: *** [build/debug/libmupdf.so.1.9] Error 1 Tested on 1.9a
since we (at gentoo) don't use the embedded openjpeg, we are applying a patch. I'll need to figure out what really happens.
I have updated the embedded openjpeg to the latest version as on 26/9/2016. I am not aware of any API changes (other than the opj_malloc changes). Thus I am at a loss to understand those missing symbols.
(In reply to Agostino Sarubbo from comment #1) > since we (at gentoo) don't use the embedded openjpeg, we are applying a > patch. I'll need to figure out what really happens. So, this isn't a bug with the code as we supply it? I am therefore closing the bug. Please reopen the bug if you find something we should change.
LFS recommends sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html It is also used for https://github.com/gentoo/gentoo/pull/3108 Sorry, it seems I have no authorization to reopen this bug.
Another patch: https://git.archlinux.org/svntogit/community.git/tree/trunk/0001-mupdf-openjpeg.patch?h=packages/mupdf