Opened 7 years ago

Closed 7 years ago

#3568 closed defect (fixed)

Linker time bug, occurs when ffmpeg is configured and make with some restrictions

Reported by: anhsoft Owned by:
Priority: normal Component: build system
Version: git-master Keywords: avi
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Summary of the bug:
Bug occurs when ffmpeg is configured and make with some restrictions, as that:

./configure --extra-ldflags="-Wl,-add-stdcall-alias" \
--enable-gpl \
--disable-optimizations \
--disable-asm \
--enable-memalign-hack \
--disable-programs \
--disable-everything \
--enable-muxer=avi \
--enable-demuxer=avi \
--enable-encoder=ffv1 \

where 'avi muxer' is present and then static library 'libavformat.a' links to any program using 'avformat'.

How to reproduce:
Configure and make ffmpeg-2.2.1 (in my case with gcc 4.8.1 on MinGW32 Win7 platform) as described above.
Get a ffmpeg static libs and link them to any program.
Linker message will be near such:

g++ -static -static-libgcc -static-libstdc++ -o main.exe main.o -lswscale -lavformat -lavcodec -lavutil 
D:\projects\libs\ffd\lib\libavformat.a(avienc.o): In function `avi_write_header':
d:\ffmpeg/libavformat/avienc.c:317: undefined reference to `av_convert_lang_to'
collect2.exe: error: ld returned 1 exit status

PS: as it is follows from error message, the function 'av_convert_lang_to' isn't in 'libavformat.a' library. 'av_convert_lang_to' is declared and implemented in avlanguage.h and avlanguage.c respectively, but for some reason aren't makes with the specified configuration.
I manually corrected the Makefile in folder 'libavformat' of the ffmpeg source, having changed a line

OBJS-$(CONFIG_AVI_MUXER) += avienc.o


OBJS-$(CONFIG_AVI_MUXER) += avienc.o avlanguage.o

and then the problem is solved...

Change History (5)

comment:1 Changed 7 years ago by anhsoft

  • Component changed from undetermined to avformat
  • Keywords libavformat.a avienc.c av_convert_lang_to added
  • Version changed from unspecified to 2.2.1

comment:2 Changed 7 years ago by Cigaes

Please try the following change in libavformat/Makefile:

OBJS-$(CONFIG_AVI_MUXER)                 += avienc.o

OBJS-$(CONFIG_AVI_MUXER)                 += avienc.o avlanguage.o

If it works for you (I am too lazy to rebuild to test), I will submit a proper patch on the mailing-list.

comment:3 Changed 7 years ago by cehoyos

  • Component changed from avformat to build system
  • Keywords libavformat.a avienc.c av_convert_lang_to removed

While the patch is probably correct, I don't think this issue is reproducible:
Please try to remove the options that are not needed to reproduce (I believe only --disable-everything --enable-muxer=avi should be needed), particularly please test without --extra-ldflags and without -disable-programs and please confirm that you are using an unchanged version of FFmpeg.

comment:4 Changed 7 years ago by cehoyos

  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from 2.2.1 to git-master

It is reproducible with ./configure --disable-everything --disable-network --enable-muxer=avi

comment:5 Changed 7 years ago by cehoyos

  • Keywords avi added
  • Resolution set to fixed
  • Status changed from open to closed

Fixed in c150e2cf - thank you for the report and the patch!

For future tickets: If you have a patch fixing an issue, please send it - as attachment made with git format-patch - to the ffmpeg-devel mailing list, patches are usually ignored on this bug tracker.

Note: See TracTickets for help on using tickets.