[FFmpeg-devel] [PATCH] libopenjpeg: do not define OPJ_STATIC for shared builds

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Oct 11 21:26:01 EEST 2016

On 11.10.2016 19:13, Hendrik Leppkes wrote:
> On Tue, Oct 11, 2016 at 5:50 PM, Andreas Cadhalpun
> <andreas.cadhalpun at googlemail.com> wrote:
>> Setting OPJ_STATIC when building shared libraries with openjpeg 2 causes
>> the openjpeg symbols to have visibility hidden and the final linker step
>> to fail due to undefined references.
> Aren't these type of macros typically related to the way the library
> (ie. openjpeg) is being linked into avcodec (or ffmpeg), and not what
> kind of library we're building?

Indeed, you're right. Building a static ffmpeg fails, as well.
However, configure doesn't detect this, because it checks the header and
the function separately.
Also it adds -DOPJ_STATIC to EXTRALIBS, where it is rather useless,
instead of to CFLAGS, where it would affect the code. This explains the
explicit '#define  OPJ_STATIC', which shouldn't be needed at all.
And it just assumes that libopenjpeg is built statically...

I'll send a patch fixing configure. Consider this patch dropped.

Best regards,

More information about the ffmpeg-devel mailing list