Opened 2 years ago

Closed 2 years ago

#5694 closed defect (fixed)

ffmpeg git master compile error on libopenjpeg

Reported by: bermond Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: libopenjpeg
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm getting the following compile error on libopenjpegdec.c and libopenjpegenc.c when trying to compile ffmpeg git master on linux x86_64:

LD      ffmpeg_g
libavcodec/libavcodec.a(libopenjpegdec.o): In function `libopenjpeg_decode_frame':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:378: undefined reference to `opj_create_decompress'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:396: undefined reference to `opj_set_error_handler'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:397: undefined reference to `opj_set_warning_handler'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:398: undefined reference to `opj_set_info_handler'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:409: undefined reference to `opj_setup_decoder'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:414: undefined reference to `opj_stream_default_create'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:431: undefined reference to `opj_stream_set_read_function'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:432: undefined reference to `opj_stream_set_skip_function'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:433: undefined reference to `opj_stream_set_seek_function'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:435: undefined reference to `opj_stream_set_user_data'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:441: undefined reference to `opj_stream_set_user_data_length'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:443: undefined reference to `opj_read_header'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:372: undefined reference to `opj_create_decompress'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:554: undefined reference to `opj_image_destroy'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:556: undefined reference to `opj_stream_destroy'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:557: undefined reference to `opj_destroy_codec'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:495: undefined reference to `opj_decode'
libavcodec/libavcodec.a(libopenjpegdec.o): In function `libopenjpeg_decode_init':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:338: undefined reference to `opj_set_default_decoder_parameters'
libavcodec/libavcodec.a(libopenjpegdec.o): In function `libopenjpeg_static_init':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegdec.c:567: undefined reference to `opj_version'
libavcodec/libavcodec.a(libopenjpegenc.o): In function `libopenjpeg_encode_frame':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:705: undefined reference to `opj_create_compress'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:716: undefined reference to `opj_set_error_handler'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:717: undefined reference to `opj_set_warning_handler'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:785: undefined reference to `opj_stream_destroy'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:786: undefined reference to `opj_destroy_codec'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:718: undefined reference to `opj_set_info_handler'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:724: undefined reference to `opj_setup_encoder'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:729: undefined reference to `opj_stream_default_create'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:757: undefined reference to `opj_stream_set_write_function'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:758: undefined reference to `opj_stream_set_skip_function'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:759: undefined reference to `opj_stream_set_seek_function'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:761: undefined reference to `opj_stream_set_user_data'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:768: undefined reference to `opj_start_compress'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:769: undefined reference to `opj_encode'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:770: undefined reference to `opj_end_compress'
libavcodec/libavcodec.a(libopenjpegenc.o): In function `libopenjpeg_encode_close':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:798: undefined reference to `opj_image_destroy'
libavcodec/libavcodec.a(libopenjpegenc.o): In function `libopenjpeg_encode_init':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:307: undefined reference to `opj_set_default_encoder_parameters'
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:384: undefined reference to `opj_image_destroy'
libavcodec/libavcodec.a(libopenjpegenc.o): In function `mj2_create_image':
/storage/ffmpeg-full-git/src/ffmpeg-full-git/libavcodec/libopenjpegenc.c:287: undefined reference to `opj_image_create'
/usr/bin/ld: ffmpeg_g: hidden symbol `opj_read_header' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:131: ffmpeg_g] Error 1

Using libopenjpeg 1.5.2 and gcc 6.1.1.

I can confirm that ffmpeg git master was compiling perfectly until a few commits ago. Last tested commit that compiled well was 88d9c30cf57ec7328f16a241f10c84415e9aef4e.

How to reproduce:

$ git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg-full-git
$ cd ffmpeg-full-git
$ ./configure --prefix=/usr --enable-libopenjpeg
$ make

Thank you.

Attachments (1)

ffmpeg_opj2.patch (1.9 KB) - added by belegdol 2 years ago.
patch fixing build failure

Download all attachments as: .zip

Change History (11)

comment:1 Changed 2 years ago by jamrial

Are you sure it's not a problem in your environment or your build folder? There are only four new commits after the one you say was good, and none of them touch the libopenjpeg wrapper code or even the configure script.

comment:2 follow-up: Changed 2 years ago by llogan

I believe that particular git hash is irrelevant. Do you also have openjpeg2 installed? Possibly related to the recent update to openjpeg2-2.1.1-1 package.

comment:3 in reply to: ↑ 2 Changed 2 years ago by bermond

I've tracked down this issue and llogan is right. It really has nothing to do with any commmit in ffmpeg development. The problem is related to the newly released libopenjpeg2 2.1.1.

I made tests in two machines. There is no error when compiling with libopenjpeg2 2.1.0. The described error shows at link time when using libopenjpeg2 2.1.1.

comment:4 Changed 2 years ago by cehoyos

  • Priority changed from important to normal

Changed 2 years ago by belegdol

patch fixing build failure

comment:6 Changed 2 years ago by belegdol

The attached patch is courtesy of Sandro Mani.

comment:7 Changed 2 years ago by cehoyos

Does the patch allow compilation with libopenjpeg 2.1.0 and older versions?

comment:8 Changed 2 years ago by belegdol

It works with 2.1.1 and 1.5.1. For 2.1.0 I would need more time to test as all supported Fedora releases have already updated to 2.1.1.

comment:9 Changed 2 years ago by bermond

This issue is fixed by git commit 7a65aef00d113a38e0d1a54df49eead9df6aa15c.

Now ffmpeg git master is correctly compiling when both libopenjpeg and libopenjpeg2 are installed.

comment:10 Changed 2 years ago by bermond

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.