Is it possible to compile ffmpeg in visual studio 2010? - c++

Is it possible to compile the sourcecode from ffmpeg in visual studio 2010? Is it difficult?
Just looking for some advice (and instructions) if possible. :-)
Cheers,
Pete

Apparently someone at Google has written a C99 to C89 "downconverter" in part to get ffmpeg to compile with Visual Studio:
http://blogs.gnome.org/rbultje/2012/09/27/microsoft-visual-studio-support-in-ffmpeg-and-libav/
The tool they wrote is currently only in source code form. Although that tool is written in C, it uses some compiler specific includes, specific to the Clang compiler, so you currently need clang to compile it. I had to get all the pieces to Clang (which relies on llvm) and compile with VS2010. OK, got that figured out, so now I have the two tools compiled: c99wrap.exe and c99conv.exe.
The blog does not mention two important things that are mentioned here:
http://libav.org/platform.html#Microsoft-Visual-C_002b_002b
First, you have to ensure the link.exe you use is the Visual C linker and not the mingw linker. Also, the msvc toolchain under msys does not yet support shared DLL builds, it only supports static lib builds at this time, so --enabled-shared fails to link.

It is not possible because ffmpeg makes extensive use of C99 features (with good reason), and MSVC doesn't support nearly enough nook and crannies of the standard.
You can however, use the C library built by MinGW for use with Visual Studio projects. See the following links for all the information you need:
Information about building/using the library on Windows with Visual Studio: http://ffmpeg.arrozcru.org/wiki/index.php?title=Main_Page
Downloads: http://ffmpeg.arrozcru.org/autobuilds/

Of course it is possible
To use FFmpeg SVN libraries with your Microsoft Visual C++ project,
you must first make sure your Microsoft Visual C++ build system has
the inttypes.h and stdint.h include files.
How do I know if I have those files? Well... unless you already did
this and know you have that file, you don't have it. MSVC++ does not
adhere to the C99 standard, where that file is specified, so you're on
your own here.
Alexander Chemeris was nice enough to make such files for Microsoft
Visual C++, so they can be found here
Download latest archive from link above and unpack it to the folder to
which you installed FFmpeg's include files. The default path is
/usr/local/include, which is, in this guide for Windows,
C:\msys\local\include.
Inttypes C99

Visual Studio 2013 provides the support for C99 which was missing earlier. With this ffmpeg can now be built using Visual Studio 2013. You can read more about the new language/libraries features here.
Also, try out Visual Studio 2013 RC here.

According to the documentation it is not possible.

Related

Visual Studio 2017, experimental/optional - No such file or directory [duplicate]

I want to use std::experimental::optional, but MSVS 2013 tells me it can't find the header.
Why isn't it there?
Can I roll my own based on code elsewhere? The C++14 proposal maybe?
std::experimental::optional originates from the Boost.Optional library, and this implementation works well in Visual C++ 12.0 (though it differs a little). Reference single-header implementation, based on the N3793 proposal paper, can be found here.
The latest list of supported C++11/14/1z core and library features that are shipped with Visual Studio can be found from the Visual C++ Team blog, from this post in particular. A set of header files of the Standard Library implementation (and some extensions) from Microsoft can be viewed here.
I've found that this implementation compiles with MSVC2013. Note that only compiles, everything else isn't guaranteed.
https://github.com/mapbox/variant/blob/master/include/mapbox/optional.hpp
I was using this one for msvc2015 and it worked:
https://raw.githubusercontent.com/akrzemi1/Optional/master/optional.hpp

How can I setup CMake for use with Visual Studio 2017RC and CUDA 8.0?

Visual Studio 2017 RC includes much tighter CMake integration, allowing one to skip the intermediate step of generating project/solution files and use CMake effectively as the project file itself. There is sufficient documentation from Microsoft for using these features with regular C++ files, and there is sufficient documentation on this website (example) for making CUDA and Cmake play nicely, when it comes to linking CUDA code to C++ code.
What I can't find information on is how to make CMake, Visual Studio 2017 RC, and CUDA 8.0 all play nicely. This is a difficult problem, because 2017RC has no integration for the CUDA SDK anyways, and I was hoping to use 2017RC so that my C++ interface to the CUDA code could use C++14 and/or C++17. I'm working on the beginning of a large project that will primarily involve writing a static CUDA library that is accessed through C++: so, I'd like to get the CMake to take care of compiling my CUDA sources into a static library, and for it to help with feeding the linking information to Visual Studio. So far, I haven't had any success with using FindCUDA's various features to accomplish this, but I'm assuming that's due to a misunderstanding on my part. I've read through the documentation on separable compilation from Nvidia, but that wasn't helpful for figuring out CMake.
Further, whenever I try to use CMake in VS2017RC, I still end up with the various vcxproj files that CMake likes to spit out. Is this due to an error on my part? How do I edit the build command arguments, or CMakeLists.txt, to get the functionality demonstrated here to work?
The very short (and only at the time of writing) answer is that you can't. CUDA 8 doesn't support VS2017. Only VS2015 is presently supported.
You can always find the compiler/IDE versions which the release version of CUDA supports here
Edit to add that the CUDA 9 release will add official support for VS2017.
All you need to do is set the CUDA_HOST_COMPILER variable to a supported compiler for example the visual studio 2015 compiler.
In my case this is:
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
As both runtime libraries are binary compatible you can use the 2015 compiler within CUDA and compile all the rest of the application with the 2017 compiler.

How to build o2scl with visual studio?

I want to build o2scl with visual studio. o2scl is a C++ wrapper for a GNU library. Seems like I have to use a configure and make file, some install instructions are available here. I guess they are targeted for the gcc compiler. I have never done this kind of thing before. I was wondering if anyone could tell me how to do this or point me to somewhere I can get upto speed on building these types of libraries with visual studio?
Thanks for reading
I'm the O2scl lead developer. I have indeed installed O2scl with compilers other than gcc (Pathscale, Intel C, etc.), but it appears that compilation with visual studio will
take a bit more effort. the O2scl directory and makefile structure is very similar to that used by GSL (GNU Scientific Library), so whatever visual studio files are necessary for GSL
will probably be adaptable for O2scl. See
http://gladman.plushost.co.uk/oldsite/computing/gnu_scientific_library.php
for an example of someone who's designed a system for installing GSL in visual studio.
Note that O2scl requires GSL so you might have to start by installing GSL first. I'm
away on travel this weekend, but I will check this out next week if I can.

Linking against older version of runtime with newer version of MSVC?

I own VS 2008 Pro, and would like to do compatibility testing with VS 2005's runtime MSVCRT80, but I do not want to buy it just for that. Is there a way to link against MSVCRT80 without getting VS 2005?
Thanks
Official support for native multi-targeting didn't appear until Visual Studio 2010, which allows you to select either v100 or v90 as your "Platform Toolset". There is no such feature in Visual Studio 2008.
There is a discussion here on how one can achieve the same effect in Visual Studio 2008, but it appears you need to have VS 2005 installed on your computer as well in order for this to work. It isn't going to work if you just have the runtime libraries installed because you need the proper version of the compiler and linker, which you'll only have if you install VS 2005.
On that note, I'm not really sure what you mean by "compatibility testing". If you compile your app against v90 in VS 2008, it's not going to work with the older versions of the runtime. You have to compile and link against the version you want your app to use.
Finally, consider whether it's really relevant or not. Since you must include MSVCRT with your application anyway, what's the advantage of trying to link against an older version of the runtime? Just include v90 and be done with it.
Links to a still-working (as of 11 Jan 2011) Microsoft download for Visual C++ Express 2005 can be found here:
http://apdubey.blogspot.com/2009/04/microsoft-visual-studio-2005-express.html
This should let you compile against the VS2005 runtime without having to buy anything.
(in case the blogspot article goes away, the link for the .iso is http://go.microsoft.com/fwlink/?linkid=57034).

How do I install the minimal facilities of Visual Studio 2008 sufficient for building C++ applications using Visual Studio 2010's multitargeting?

Dev10 has facilities for using the C++ compiler shipped in Orcas. However, I really don't need to install the full IDE -- I merely need to use Orcas' compiler because I need to support Windows 2000.
What's the simplest way of installing just the bits required to build using Orcas' toolset in Dev10?
Given your condition, I'd say just install VS2008 and use it. While it's not what you want it's the fastest path to working.
What about setting up Visual studio 2008 to work with Orcas compiler ?
I'm sorry I don't know about this very compiler, but I know it's possible to use VS2008 with a different compiler, because I tried it.
You can find plenty of doc on running VS2008 with, for example, the Windows SDK compiler or VS2010 compiler. For example that links explains that quite well : http://www.codeproject.com/Tips/105011/Using-Visual-Studio-2008-IDE-with-Visual-Cplusplus.aspx
HTH