Building from Source Code

From CasparCG Wiki

Jump to: navigation, search

From http://casparcg.com/forum/viewtopic.php?f=3&t=240#p507

With some versions, I had to do strange operations to manage to compile, like modifying some .h files I shouldn't touch. It wasn't the case with the current trunk, I suppose you corrected most of the problems. By the way, I noticed the SVN repository had been refactored since, so I took up the compilation from the beginning. This documentation concerns the trunk (at revision 133).


Starting point & prerequies

Visual C++ (NOT Express edition) is used to develop & compile the project.

Checkout the server repository :

Checkout the dependencies :

(note for posterity : this tutorial has been written for the revision 133 of this two directories)

Finally, download the DirectX SDK : http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba

Build configuration

The configuration to use is Release (tutorial realised with "no bluefish").

In [Configuration Properties -> C/C++ -> Langage], I had to change the "Force Confirmance in For Loop Scope" to "No".

A necessary modification to compile : in AsyncEventServer.h, add "#include <functional>" under "#include vector" => I suppose something in your configuration make this unecessary for you, which of two solution is best ?

To match the dependencies tree in the SVN, change FFmpegManager.cpp :

  • #include <ffmpeg/avformat.h> => #include <libavformat/avformat.h>
  • #include <ffmpeg/avcodec.h> => #include <libavcodec/avcodec.h>
  • #include <ffmpeg/swscale.h> => #include <libswscale/swscale.h>

Still for dependencies matching, some paths to awaited librairies for the compilation must be changed [Configuration Properties -> Linker -> Input : Additional Dependencies] :

  • avformat-51.lib => avformat-52.lib
  • avcodec-51.lib => avcodec-52.lib
  • avutil-49.lib => avutil-50.lib
  • add swscale-0.lib

Add the dependencies to the project [Configuration Properties -> VC++ Directories]

  • add in "Include Directories" :
    • CHECKOUT_ROOT\dependencies\ffmpeg 0.6\include
    • CHECKOUT_ROOT\dependencies\GLee5_4
    • CHECKOUT_ROOT\dependencies\tbb30_20100406oss\include
    • CHECKOUT_ROOT\dependencies\WTL80\include
  • add in "Library Directories" :
    • CHECKOUT_ROOT\dependencies\tbb30_20100406oss\lib\ia32\vc10
    • CHECKOUT_ROOT\dependencies\GLee5_4
    • CHECKOUT_ROOT\dependencies\ffmpeg 0.6\lib
    • the Lib/x86 directory of the DirectX SDK (probably C:\Program Files\Microsoft DirectX SDK %28June 2010%29\Lib\x86)

The project should now build...

Personal tools