Building OpenSceneGraph with Visual Studio 2013

25 Feb

Visual Studio 2013 has been out for a few months, and OpenSceneGraph also has their latest release up to version 3.3.1. It is now possible to build OpenScenegraph, inclusive of most widely used plugins, all with Visual Studio 2013.

  • Extract the dependency packages to “C:\Osg331\3rdParty”, use contents in either the x86 or x64 folder, but not both.


  • Download and install CMake or above, this is a MUST. Otherwise, you will not see Visual Studio 2013 compiler in the drop down combo box.
  • Run CMake-gui, and fill-in the needed information as below:


Note that you can tick the “Advanced” option for you to configure plugins.

  • Press Configure button as in step 4 in the above snapshot.
  • In the popup dialog, select “VisualStudio 12 Win64”, which corresponds to Visual Studio 2013. Click Finish button.
  • The configure process continues, as below:


image  image

  • Once the Configure finishes, it is important to update a few items  as below:image  image
    You should change the C:/3rdparty to the dependency folder where you have extracted to, e.g. “C:\Osg331\3rdParty“. You might also take to build osg_examples. Note that if you want to build MFC examples. you have to first tick this “BUILD_OSG_EXAMPLES”, and then find the entry by searching “MFC” in the search box in CMAKE-GUI. You cannot find the “MFC” example entry without selecting BUILD_OSG_EXAMPLES”!
  •  Click Configure again. Type “MFC” in the serch box, and tick the “BUILD_MFC_EXAMPLE” check box
  • image image
  • Configure again, and then press Generate. You will find that many plugins are found. There might be some plugin missing, but these are not the most widely used ones, and we will leave it as is:
  • After pressing Generate button, a solution file called “OpenSceneGraph.sln” will be created in the build folder, open that file with VisualStudio 2013.image image
  • Build the solution by pressing Ctrl + Shift + B, now the entire solution is built from source.
  • Very, very time consuming, yes, grab a dozon cups of coffee…
  • Wait until it finishes, done!image
  •  If you are really really lazy, you can download the compiled OSG for x64 Windows, compiled  with Visual Studio 2013. Click below link to download. Use at your own risk and nothing is guaranteed.

Posted by on February 25, 2014 in osg, Programming


Tags: , , , , , , ,

12 responses to “Building OpenSceneGraph with Visual Studio 2013

  1. Gerard

    April 29, 2014 at 12:21 pm

    Thanks for taking the time to list the instructions for this. It all worked perfectly and was very concise. thanks!!🙂

  2. tuncatunc

    May 7, 2014 at 3:26 pm

    While building using QT5
    Win7 x86
    set(CMAKE_LIBRARY_PATH “C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0A\\Lib”)
    line to the

  3. Simon

    May 16, 2014 at 7:26 pm

    You should probably mention somewhere that Visual Studio 2013 express doesn’t include MFC

  4. xinyustudio

    May 16, 2014 at 8:49 pm

    While the fact mentioned might be useful in certain ways, this post does NOT limit Visual Studio to be express versions. Thanks.

  5. PLPeeters

    October 1, 2014 at 6:03 pm

    The compilation somehow didn’t generate the osg\Config and OpenThreads\Config files for me, so I had to get them from another installation. Here’s an archive with the files I used:!p8dDWAKb!FKUoRScbpZPEkZ_Mr1m2JjJ19D483MsbaVOTYo8tZgo

    Don’t forget to point the OSG_LIB_PATH to %OSG_ROOT%\build2\lib and the OSG_BIN_PATH to %OSG_ROOT%\build2\bin

    After that, if you want to compile OSG projects on a 64-bit computer, follow this tutorial:

  6. rich

    October 15, 2014 at 4:33 am

    Hi, the prebuilt links point to a location that does not exist. Can you fix that perhaps? I would like to use it. thanks!

  7. Kan

    January 20, 2015 at 10:56 am

    Really helps !!! Thanks~

  8. DaxDeveloper

    April 18, 2015 at 10:59 pm

    can you reload Full Pack please? Related link doesn’t work…

    Thx a lot!

  9. xinyustudio

    April 19, 2015 at 10:36 am

    Download link updated! Happy coding!

  10. hectorzx

    July 16, 2015 at 4:11 am

    hi, i get the error: missing zlibd.dll when i try to run a example. What i did wrong?

  11. hectorzx

    July 16, 2015 at 4:50 am

    the solution to my problem was adding 3rdParty bin to my PATH


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: