[Ffmpeg-devel] compiling with gcc4 (on Mac OS X)

Iz Mir izmir
Tue May 3 16:49:36 CEST 2005

I got it to compile using gcc4 on Mac OS x, but I had to patch 2  
files. I believe 1 issue was discussed a few weeks ago. I don't know  
what effects it might cause, but what limited testing I did seemed fine.

I'll just post exactly what I used, its an implementation of sed:

reinplace "s|static always_inline|always_inline|" \
reinplace "s|typedef int socklen_t|typedef struct socklen_t|" \

The second one I've never had to change on 10.3, but here is the  
(only) part in <sys/socket.h>

#ifndef _SOCKLEN_T
#define _SOCKLEN_T
typedef    __darwin_socklen_t    socklen_t;

and here is the error it produced (there are a few of the  
"signedness" warnings, but I don't think those are too worrisome):

cc -O3 -g -Wall -Wno-switch -force_cpusubtype_ALL -I/opt/local/ 
include -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common - 
force_cpusubtype_ALL -Wno-sign-compare -faltivec -I.. -I'/Users/me/ 
darwinports/localports/multimedia/ffmpeg/work/ffmpeg-0.4.9-pre6' -I'/ 
pre6'/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 - 
tcp.c:25: error: conflicting types for 'socklen_t'
/usr/include/sys/socket.h:99: error: previous declaration of  
'socklen_t' was here
tcp.c: In function 'tcp_open':
tcp.c:117: warning: pointer targets in passing argument 5 of  
'getsockopt' differ in signedness
make[1]: *** [tcp.o] Error 1
make: *** [lib] Error 2

More information about the ffmpeg-devel mailing list