[FFmpeg-devel] [PATCH] Fix linking on OS/2

Dave Yeo daveryeo
Fri Jun 4 18:05:55 CEST 2010


On 06/04/10 05:13 am, M?ns Rullg?rd wrote:
> Dave Yeo<daveryeo at telus.net>  writes:
>
>> libavformat now has a dependency on libavutil causing this error on a
>
> libavformat has depended on libavutil for as long as libavutil has
> existed.  Nothing has changed there.

r23422 added the av_get_codec_tag_string dependency, not sure about the 
ff_toupper4.

>
>> static build (similar error building a shared libavformat)
>> [...]
>> R:\tmp\ldconv_libavformat_s_a_74454c088fcb1ebd70.lib(utils.obj) :
>> error LNK2029: "_ff_toupper4" : unresolved external
>> R:\tmp\ldconv_libavformat_s_a_74454c088fcb1ebd70.lib(utils.obj) :
>> error LNK2029: "_av_get_codec_tag_string" : unresolved external
>>
>> There were 2 errors detected
>> make: *** [ffmpeg_g.exe] Error 1
>
> What is the exact command that fails?  Run "make V=1" and paste the
> last command along with the full output from it.

gcc -L"/usr/src/ffmpeg"/libavcodec -L"/usr/src/ffmpeg"/libavdevice 
-L"/usr/src/ffmpeg"/libavfilter -L"/usr/src/ffmpeg"/libavformat 
-L"/usr/src/ffmpeg"/libavutil -L"/usr/src/ffmpeg"/libpostproc 
-L"/usr/src/ffmpeg"/libswscale -Zomf -Zbin-files -Zargs-wild -Zmap  -o 
ffmpeg_g.exe ffmpeg.o cmdutils.o -lavdevice -lavfilter -lavformat 
-lavcodec -lswscale -lavutil -lz -lbz2 -lm
weakld: error: Unresolved symbol (UNDEF) '_ff_toupper4'.
weakld: info: The symbol is referenced by:
     R:\tmp\ldconv_libavformat_s_a_74454c088fcb1ebd70.lib(utils.obj)
weakld: error: Unresolved symbol (UNDEF) '_av_get_codec_tag_string'.
weakld: info: The symbol is referenced by:
     R:\tmp\ldconv_libavformat_s_a_74454c088fcb1ebd70.lib(utils.obj)
Ignoring unresolved externals reported from weak prelinker.

R:\tmp\ldconv_libavformat_s_a_74454c088fcb1ebd70.lib(utils.obj) : error 
LNK2029: "_ff_toupper4" : unresolved external
R:\tmp\ldconv_libavformat_s_a_74454c088fcb1ebd70.lib(utils.obj) : error 
LNK2029: "_av_get_codec_tag_string" : unresolved external


There were 2 errors detected
make: *** [ffmpeg_g.exe] Error 1

>
>> Fix is to rearrange the build order and linking as in the attached
>> patch or any other order where libavutil comes before libavformat. For
>> shared builds we'd still need to pass something like LDFLAGS=-Lavutil
>> -lavutil.
>> Dave
>>
>> Index: common.mak
>> ===================================================================
>> --- common.mak	(revision 23463)
>> +++ common.mak	(working copy)
>> @@ -31,7 +31,7 @@
>>   $(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
>>   endif
>>
>> -ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
>> +ALLFFLIBS = avutil avcodec avdevice avfilter avformat postproc swscale
>>
>>   CPPFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
>>   CFLAGS   += $(ECFLAGS)
>
> That patch has no effect at all.  You must be confused.
>

It changes the link order so that the missing symbols come before the 
dependency, though perhaps
+ALLFFLIBS = avcodec avdevice avfilter avutil avformat postproc swscale
would be simpler.
Dave




More information about the ffmpeg-devel mailing list