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

Hendrik Leppkes h.leppkes at gmail.com
Tue Oct 11 20:13:53 EEST 2016


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?

>
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavcodec/libopenjpegdec.c | 3 +++
>  libavcodec/libopenjpegenc.c | 3 +++
>  2 files changed, 6 insertions(+)
>
> diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
> index 65167e6..1f8dadf 100644
> --- a/libavcodec/libopenjpegdec.c
> +++ b/libavcodec/libopenjpegdec.c
> @@ -24,7 +24,10 @@
>   * JPEG 2000 decoder using libopenjpeg
>   */
>
> +#include "config.h"
> +#if !CONFIG_SHARED
>  #define  OPJ_STATIC
> +#endif
>
>  #include "libavutil/common.h"
>  #include "libavutil/imgutils.h"
> diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
> index 1443551..023fdf4 100644
> --- a/libavcodec/libopenjpegenc.c
> +++ b/libavcodec/libopenjpegenc.c
> @@ -24,7 +24,10 @@
>   * JPEG 2000 encoder using libopenjpeg
>   */
>
> +#include "config.h"
> +#if !CONFIG_SHARED
>  #define  OPJ_STATIC
> +#endif
>
>  #include "libavutil/avassert.h"
>  #include "libavutil/common.h"
> --
> 2.9.3
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list