[FFmpeg-devel] [PATCH] lavc: drop support for OpenJPEG 1.3-2.0

Michael Bradshaw mjbshaw at google.com
Thu Oct 19 00:56:32 EEST 2017

On Wed, Oct 18, 2017 at 2:44 PM, Reino Wijnsma <rwijnsma at xs4all.nl> wrote:
> Is there a reason you left out -DOPJ_STATIC?

I assumed OpenJPEG's pkgconfig file would be smart enough to add it in if
needed. Apparently that's not the case. Dang.

'openjpeg_git/src/lib/openjp2/libopenjp2.pc.cmake.in' doesn't put it in.
> With this patch ./configure therefor fails over here with:
> "test.o:test.c:(.text+0x1): undefined reference to `_imp__opj_version at 0'".
> enabled libopenjpeg       && require_pkg_config libopenjpeg "libopenjp2
> >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC
> This line fixes that.

-DOPJ_STATIC was originally added to ffmpeg's configure script for Windows.
Unconditionally adding -DOPJ_STATIC would conflict with people who are
dynamically linking. I'll look into this further. I'll start with the

enabled libopenjpeg       && {{require_pkg_config libopenjpeg "libopenjp2
>= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags
                              require_pkg_config libopenjpeg "libopenjp2 >=
2.1.0" openjpeg.h opj_version;}

and see if it works for both static and dynamic builds of OpenJPEG.
Unfortunately, I don't have a Windows system to test on, so if anyone can
validate the above on Windows I'd appreciate it.

More information about the ffmpeg-devel mailing list