I assume you're developing on windows from your tags.
Ok. If you havent set up OSG already, checkout this blog for instructions on compiling with MingW/MSYS.
The OSG wiki considers the article to be more up to date (as at May-26-13') than its wiki entry.
There's also binaries at the bottom to save you time.
Next, fire up C::B and create a new C++ console application. Follow the wizard thru to the end. Select MingW/GCC as your compiler.
- Create a new set of Global Variables. Settings -> Global Variables
- Call the new variable "OSG".
- Set the "base" field to your OSG root folder
- Optional: Set the "include" field to your OSG include folder
- Optional: Set the "lib" field to your OSG libs folder
- Open project -> build options.
- go to the "Search Directories" tab
- under the "compiler" tab add $(#OSG.include)
- under the "linker" tab add $(#OSG.lib)
- Click the "Linker Setings" tab and copy paste the following libs (according to your projects needs) under the "Other linker options" textbox. Each should be separated by a new-line AS IS.
-losg -losgGA -losgDB -losgViewer -losgText -losgUtil -lOpenThreads
- Click ok.
- Goto File -> Save everything (optional but if C::B crashes, you might wish you did this)
- Copy paste all the code from this tut/example into your main.cpp and try compiling.