Ogre3D and NetBeans on Windows

I just started a project I was waiting to start for so long. Before writing design documents, planning classes and stuff, I started setting up the development environment.

I’m working on Windows XP with MinGW, I’m used to C/C++ development  in GNU/Linux (vim, make, …) but in the last years I coded a lot in Java using NetBeans IDE. So I wanted to setup NetBeans in order t take advantage from code completion and syntax check.

When I stumbled on Ogre SDK support in Eclipse I thought “I’m done”. I was wrong.

What doesn’t work is the path system for includes and libraries. Using ${OGRE_HOME} will lead to a “Build failed” message.

Include directories and libraries path must be in a slash form, i.e. c:/OgreSDK/include;c:/OgreSDK/samples/include

I changed some other setting, here is the full working setup (assuming Ogre installed in C:\OgreSDK):

  • C++ Compiler
    • Include directories: c:/OgreSDK/include;c:/OgreSDK/samples/include
    • Preprocessor definitions:
      • WIN32
      • _WINDOWS
      • _DEBUG
    • Additional options (add -v if you need more control): -fmessage-length=0 -mthreads -fexceptions -fident
  • Linker
    • Additional library directories: c:/OgreSDK/bin/debug
    • Libraries: (use add library button)
      • OgreMain_d
      • OIS_d
    • Additional options: --enable-auto-image-base --add-stdcall-alias

If you want to run your project directly from NetBeans, add this setting in Linker->Runtime search directories: C:/OgreSDK/bin/debug;C:/Programs/Microsoft DirectX SDK (August 2006)/Developer Runtime/x86

Same story for “release” build, just change _DEBUG with NDEBUG, use normal libraries instead of debug ones (throw away the _d from library name) and use “release” instead of “debug” path for libraries.

(assuming that you need DirectX and you installed it in that directory)

Be sure to avoid adding extra spaces in paths and settings.

Leave a Reply