Version 1 (modified by martin, 7 years ago)

--

Mingw

Follows are details on usage of OpenSceneGraph such as how to get things compiling using Mingw.

Compiling OpenSceneGraph with Mingw and MSYS

First you must create some initial environment variables so that the OpenSceneGraph build process knows where OpenThreads and Producer are installed. The best place to locate these variables is in a profile initialization script file. MSYS has one in it's /etc directory but it best to create a local one in the /home/yourusername directory located in the main MSYS folder.

So create a file in a text editor, name it .profile and save it in the /home/yourusername directory. MSYS will automatically process this file when the console is started.

Add these variables to the file:

export OPENTHREADS_INC_DIR="/usr/local/OpenThreads/include"
export OPENTHREADS_LIB_DIR="/usr/local/OpenThreads/bin"
export PRODUCER_INC_DIR="/usr/local/Producer/include"
export PRODUCER_LIB_DIR="/usr/local/Producer/bin"

Next you must add these paths and the path to the OpenSceneGraph installed bin directory to the systems PATH environment variable:

export PATH="/usr/local/OpenSceneGraph/bin:$OPENTHREADS_LIB_DIR:$PRODUCER_LIB_DIR:$PATH"

The $PATH variable on the end makes sure that any previously assigned paths are also included.

Thats all that needs to be done for the .profile script file, though you could also add the variable that specifies the directory of the OpenSceneGraph data, or any other variables that are particular to your setup.

export OSG_FILE_PATH="/usr/local/OpenSceneGraph/data"

The above path is specific to where I put the data, change accordingly to where your data resides.

Now startup the MSYS console and if you've not already done so, make and install OpenThreads and Producer.

NOTE:

Before building Producer, create a new folder called MINGW32 in the Producer/lib directory.
Similarly for OpenSceneGraph, create a new folder called MINGW in OpenSceneGraph/lib directory.
The build process will fail if this is not done, not sure why this happens.

Everything should be in place now, so just cd into the OpenSceneGraph directory and type make, hopefully it should build successfully.