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

Adam Billyard adambillyard at googlemail.com
Sun Aug 23 08:02:52 CEST 2009


And just for completeness, I find I need to #define a log2() function  
to build in VS.

On 23 Aug 2009, at 07:54, Mathieu Monnier wrote:

> 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
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel



More information about the x264-devel mailing list