[x264-devel] C Style X264 not easily compiled in Visual Studio.

Mathieu Monnier manao at melix.net
Sun Aug 23 07:54:15 CEST 2009


Hi,

Both previous answers are somewhat correct (x264 is written in C99, MSVC 
doesn't support all the features of C99). However, they are also missing 
the point regarding your particular issue.

You are somehow attempting to link twice libx264 to x264, or you 
compiler twice encoder.c into libx264, or something like that.

Also, to be accurate, the only C99 feature, not supported by MSVC, used 
by x264 during the compilation is declaration of variable anywhere in 
the code. Those are easily fixed by opening a new scope just before the 
declaration of those variables.

If I take the .sln file, convert it to MSVC 2008, and fix every 
occurences of variable declaration errors, and if I set #define PRIx32 
"d" in muxers.c, I manage to build & link x264.

Also, x264 also relies strongly on the fact that the stack is aligned to 
16. MSVC can't ensure that, so some ASM functions are explicitely 
disabled. Depending on what you want to do, it might prove a problem.

Regards,

Mathieu



More information about the x264-devel mailing list