Dependencies |
![]() |
![]() |
![]() |
Installing OpenSceneGraphGet OpenSceneGraph from http://www.openscenegraph.org. Environment Variables for OSG If you select the first method, a way to simplify things and to make your project files work on multiple different machines is to use some standard environment variables. I use the following: OSG_ROOT points to the base of the OSG file structure (the directory that contains include, src etc. subdirectories) OSG_BIN_PATH = %OSG_ROOT%\bin OSG_INCLUDE_PATH = %OSG_ROOT%\include OSG_LIB_PATH = %OSG_ROOT%\lib OSG_SAMPLES_PATH = %OSG_ROOT%\share\OpenSceneGraph\bin OSG_FILE_PATH = ???\OpenSceneGraph-Data-X.X Then, add %OSG_BIN_PATH% and %OSG_SAMPLES_PATH% to your PATH environment variable. That way, not only can you run examples easily, but the latest DLLs will always be found. When starting an application, Windows looks for the required DLLs first in the executable's directory, then in the PATH. Make sure you restart Visual Studio if it was open when you added/changed these environment variables, so that it picks up te changes. In your project's properties, use those environment variables to get Visual Studio to find the OSG libraries. Here are the settings I use: ( again you can ignore this when using the simulator solution file ) Properties - C/C++ - General - Additional Include Directories = $(OSG_INCLUDE_PATH) Properties - C/C++ - Preprocessor - Preprocessor Definitions = WIN32;_WIN32;NDEBUG Properties - Linker - General - Additional Library Directories = $(OSG_LIB_PATH) Properties - Linker - Input - Additional Dependencies = (any OSG library your project needs - for example: osg.lib osgGA.lib osgDB.lib osgViewer.lib osgText.lib osgUtil.lib OpenThreads.lib) Remember to do the same thing in your project's Debug configuration, but add a d to the end of the OSG and OpenThreads library names (osg.lib becomes osgd.lib and so on). Also change NDEBUG to _DEBUG in the Preprocessor Definitions. Once that's done, your project should be able to compile, link and run. If not, you can test your paths in a console (Start-Run, type cmd, press enter), by for example typing echo %OSG_LIB_PATH% or dir %OSG_LIB_PATH%. With those commands you should be able to see what is wrong. A2 - Getting CMakeOpenSceneGraph as well as CurvaceSimulator require CMake to build. A3 - Installing QT4For windows you can get the qt4 libraries from http://qt.nokia.com/downloads and follow the installation instructions. Be sure to get the visual studio libraries (Qt libraries... for windows (VS ...) ) if you use VS, since those are not included in the SDK. Create an environment variable QT_PATH pointing to the installation directory of QT and add %QT_PATH%\bin to your PATH variable. Be sure to get the 'Qt libraries ... for windows ( VS ... )' For linux you can usually install qt4 through your packet manager. |