This tutorial will explain how to compile OpenSceneGraph using MinGW with the source code from the SVN.

Last update: 11/03/2010
Notes:
Switched from MinGW nuwen.net to MinGW provided by Qt/Trolltech for better compatibility with Qt examples.

Requirements

Before following this tutorial, make sure that you have read the  the previous two tutorials:

The first one explains how to setup a MinGW/MSYS development environment, the second one explains how to install commonly used libraries in MinGW (most of them are required to build OpenSceneGraph).

Additional dependencies

FFmpeg

Qt 4.6.2

CMake

  • CMake (cmake-2.8.0-win32-x86.exe)
  • Install using default settings

Download the sourcecode from the OSG SVN

Preparing OpenSceneGraph (CMake)

  • Launch Cmake
  • Set “Where is the source code” to: C:/Projects/OpenSceneGraph/OpenSceneGraph-SVN
  • Set “Where to build the binaries” to: C:/Projects/OpenSceneGraph/OpenSceneGraph-Build
  • Click Configure
  • Choose MSYS Makefiles (Use default native compilers) and click on Finish
  • Enable “Simple View”
  • Set “ACTUAL_3DPARTY_DIR” to: C:/mingw
  • Enable BUILD_OSG_EXAMPLES
  • Set “CMAKE_BUILD_TYPE” to: Release
  • Set “CMAKE_INSTALL_PREFIX” to: C:/Projects/OpenSceneGraph/OpenSceneGraph-Bin
  • Click Configure
  • Enable “Grouped View”
  • Most of the libraries should’ve already been found, however there are a few you need to add manually
  • Set “TIFF_LIBRARY” to: C:/mingw/lib/libtiff.dll.a
  • Set “SDL_INCLUDE_DIR” to: C:/mingw/include/SDL
  • Set “SDL_LIBRARY” to: C:/mingw/lib/libSDL.dll.a
  • Set “QT_INCLUDE_DIR” to: C:/Qt/4.6.2/include
  • Set “QT_MOC_EXECUTABLE” to: C:/Qt/4.6.2/bin/moc.exe
  • Set “QT_QASSISTANTCLIENT_LIBRARY” to: C:/Qt/4.6.2/lib/libQtAssistantClient4.a
  • Set “QT_QMAKE_EXECUTABLE” to: C:/Qt/4.6.2/bin/qmake.exe
  • Set “QT_MAIN_LIBRARY” to: C:/Qt/4.6.2/lib/libqtmain.a
  • Set “QT_UIC_EXECUTABLE” to: C:/Qt/4.6.2/bin/uic.exe
  • Set “LIBXML2_INCLUDE_DIR” to: C:/mingw/include/libxml
  • Set “LIBXML2_LIBRARIES” to: C:/mingw/lib/libxml2.a
  • Set “GLUT_LIBRARY” to: C:/mingw/lib/libglut.dll.a
  • Set “GIFLIB_LIBRARY” to: C:/mingw/lib/libgif.a
  • Set “FREETYPE_INCLUDE_DIR” to: C:/mingw/include/freetype2
  • Set “FREETYPE_INCLUDE_DIR_freetype2″ to: C:/mingw/include/freetype2
  • Set “FREETYPE_INCLUDE_DIR_ft2build” to: C:/mingw/include/freetype2
  • Set “FFMPEG_ROOT” to: C:/Projects/3rdParty/ffmpeg
  • Set “SDLMAIN_LIBRARY” to: C:/mingw/lib/libSDLmain.a
  • Set “GLUT_glut_LIBRARY” to: C:/mingw/lib/libglut.dll.a
  • Click Configure
  • Click Configure
  • Click Generate

Building OpenSceneGraph

  • Open MSYS
  • Change your directory: cd /c/Projects/OpenSceneGraph/OpenSceneGraph-Build/
  • Type “make” and hit enter
  • Type “make install” and hit enter
  • Done! (OpenSceneGraph should now be installed in:
    C:\OpenSceneGraph\OpenSceneGraph-Bin)

Binaries (SVN)

Can’t be bothered to compile the source from scratch? Download the (release) binaries here:

Use 7zip to extract the content.

Additional resources