Opened 10 years ago

Closed 10 years ago

#3568 closed defect (fixed)

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

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

Description

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 \
--enable-decoder=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

to

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

and then the problem is solved...

Change History (5)

comment:1 by Anh, 10 years ago

Component: undeterminedavformat
Keywords: libavformat.a avienc.c av_convert_lang_to added
Version: unspecified2.2.1

comment:2 by Cigaes, 10 years ago

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 by Carl Eugen Hoyos, 10 years ago

Component: avformatbuild 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 by Carl Eugen Hoyos, 10 years ago

Reproduced by developer: set
Status: newopen
Version: 2.2.1git-master

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

comment:5 by Carl Eugen Hoyos, 10 years ago

Keywords: avi added
Resolution: fixed
Status: openclosed

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.