I know that I need zlib, libpng, libjpeg-turbo and yasm.
I've successfully built them and correctly installed (hope so), because when I try to "make" libbpg with following config in Makefile:
# Enable compilation of Javascript decoder with Emscripten
#USE_EMCC=y
# Enable x265 for the encoder
USE_X265=y
# Enable the JCTVC code (best quality but slow) for the encoder
USE_JCTVC=y
# Compile bpgview (SDL and SDL_image libraries needed)
#USE_BPGVIEW=y
# Enable it to use bit depths > 12 (need more tests to validate encoder)
USE_JCTVC_HIGH_BIT_DEPTH=y
# Enable the cross compilation for Windows
CONFIG_WIN32=y
# Enable for compilation on MacOS X
#CONFIG_APPLE=y
I didn't see any severe error in my terminal's output when building "bpgdec.exe" and H265 encoder.
However, when it comes to jctvc, I had a BIG error message (most of it is nearly repeating)
......
x86_64-w64-mingw32-g++ -g -Wl,--gc-sections -o bpgenc.exe bpgenc.o x265_glue.o x265.out/8bit/libx265.a x265.out/10bit/libx265.a x265.out/12bit/libx265.a jctvc_glue.o jctvc/libjctvc.a -lpng -ljpeg -lz
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `OptionBase':
(somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:81: undefined reference to `__gxx_personality_sj0'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:81: undefined reference to `_Unwind_SjLj_Register'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:82: undefined reference to `_Unwind_SjLj_Unregister'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o):/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/ext/new_allocator.h:86: undefined reference to `_Unwind_SjLj_Resume'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `ParseFailure':
(somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:54: undefined reference to `__gxx_personality_sj0'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:54: undefined reference to `_Unwind_SjLj_Register'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:55: undefined reference to `_Unwind_SjLj_Unregister'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:55: undefined reference to `_Unwind_SjLj_Resume'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `df::program_options_lite::Option<double>::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:118: undefined reference to `__gxx_personality_sj0'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:118: undefined reference to `_Unwind_SjLj_Register'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:120: undefined reference to `_Unwind_SjLj_Unregister'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:120: undefined reference to `_Unwind_SjLj_Resume'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `df::program_options_lite::Option<bool>::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
......
collect2: error: ld returned 1 exit status
make: *** [Makefile:197:bpgenc.exe] errorcode 1
(To give an example)
I've noticed that Mingw-w64 on linux is using an gcc version whose Exception Handling is dw2 instead of sjlj, which is required for jctvc according to the output above.
I've tried to move libgcc_s_sjlj_1.dll to /usr/x86_64-w64-mingw32/bin and /usr/x86_64-w64-mingw32/lib, but it doesn't work.
I've known that gcc can be configured to enable sjlj, but this means that I have to modify mingw-w64, which is something I can't dare.
MY ENVIRONMENT: Freshly installed debian 10, after "apt update&&apt upgrade". All latest zlib, libjpeg-turbo, libpng, mingw-w64, libbpg source code.
So I'd like to know if anybody know the proper way to compile jctvc in libbpg. Thanks a lot.