MSVC Support

Luca Barbato edited this page Aug 31, 2013 · 2 revisions


Microsoft Visual Studio Compiler support started with a proof of concept from Ronald S. Bultje and is being polished by me, Martin Storsjö and other volunteers.

The progress is slow partially because none of us has particular pressing interest on supporting a broken compiler, yet for some unfathomable reasons we are still trying to get it in a proper shape.

Microsoft Visual Studio C conversion support

Since Microsoft does not provide a C99 compliant compiler and does not show any interest in providing one and apparently Microsoft Visual Studio users had silently complained about it for long, this section provides a way to preprocess the Libav sources and enable people to compile natively the result.


  • The source converter is partially complete and some shortcomings are being worked around by hacking the codebase. Ideally help in supporting more C99 constructs is welcome

  • The C99 headers provided from third parties are bundled for convenience

  • The process requires unix tools, look at cygwin or msys for them.

  • The project file generation is missing, contributions on this is more than welcome

  • a Makefile target for the conversion is still incomplete


Currently you have to manually build the c99-to-msvc processor, manually run the conversion script and run the standard configure.

My branch has a not so complete Makefile, issue 'make convert' from the msvc directory to do the conversion.

Usage on wine

To Be Documented - it is possible currently though =)


My idea is to make the post processor smarter and avoid ALL the possible restriction to our language usage on Libav, that means that we shall not move from our current C99/C11 subset because MSVC doesn't support it.

In order to achieve that the preprocessor will be mold a lot to take care of constructs like variadic macros and other small details. Help in this field is much required.

Ideally people should always work on the original source and build using the preprocessor on the fly, currently it is impossible since the preprocessor is really heavy and takes ages to get the source converted.

Preprocessor tasks

  • The current processor does need to know in advance the structure and union layouts, contribution to make this part automatic would be much appreciated.

  • The preprocessor is really slow and should probably enjoy an overhaul to directly use mmap, if somebody with window experience wants to help me supporting windows equivalent feature it would be great.

Other ways to help

  • Complain loudly to Microsoft: make so they support C11 at least.
  • Complain loudly to whoever is using MSVC: that compiler is broken, there are other compilers on windows.
  • If you are a Microsoft Visual Studio user, please try and document how icc and llvm work within the ide, using a less broken compiler for C would help everybody.


Bounties and money offer to speedup the process are more than welcome, the core Libav team has no particular interest in supporting a broken compiler, given that ICC, mingw64, LLVM/Clang are available on windows and produce acceptable results for the target platform and seem to get a decent degree of integration on the Microsoft Visual Studio IDE.