[FFmpeg-devel] [PATCH] fix implicit function declarations without _XOPEN_SOURCE

David Conrad lessen42
Mon Aug 25 19:01:22 CEST 2008


On Aug 25, 2008, at 9:39 AM, "Adrian Stutz" <adrian at sttz.ch> wrote:

> Hi,
>
> This patch broke compiling on OSX 10.5 against the 10.4 SDK.

Works for me.

It sounds like you're using 10.5 headers. Make sure you're specifing  
the sdk in cflags as well as ldflags. Otherwise make sure you have the  
latest developer tools.

> The problem seems to be that _XOPEN_SOURCE forces _DARWIN_UNIX03. OSX
> Leopard introduced full UNIX 03 compatibility and postfixed all  
> relevant
> symbols with $UNIX2003. To compile with backward compatibility,
> mmacosx-version-min has to be set to compile against the old not- 
> suffixed
> symbols.
>
> _XOPEN_SOURCE is set in libavcodec/utils.c and forces it to compile  
> against
> the UNIX03 symbols. This causes a undefined symbol error when trying  
> to link
> libavcodec:
>> Undefined symbols:
>> "_strtod$UNIX2003", referenced from:
>>     _av_parse_video_frame_rate in libavcodec.a(utils.o)
>> ld: symbol(s) not found
>
> Removing _XOPEN_SOURCE from utils.c makes libavcodec link correctly  
> again.
>
> Or that's at least what I could gather. Here's some more information:
> http://developer.apple.com/releasenotes/Darwin/SymbolVariantsRelNotes/index.html
> http://archive.netbsd.se/?ml=sqlite-users&a=2007-11&t=5807563
>
> Greetings
> Adrian
>
> On Wed, Aug 13, 2008 at 11:40:47PM +0200, Aurelien Jacobs wrote:
>> Hi,
>>
>> When compiling without _XOPEN_SOURCE defined globally, there are a  
>> few
>> "implicit function declaration" warnings appearing. This might cause
>> serious trouble on 64 bits arch (segfault, etc...).
>> Attached patch adds a few define to some files, to ensure the  
>> prototypes
>> of the following functions are imported:
>> - usleep()
>> - mkstemp()
>> - gethostname()
>> - inet_aton()
>>
>> With this patch applied, I think that global _XOPEN_SOURCE can  
>> definitely
>> be dropped, without any kind of trouble.
>>
>> Aurel
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel




More information about the ffmpeg-devel mailing list