I am trying to compile an Ogre project in VS .NET 2003 combined with
Ruby as a script language. I get strange errors during compile. I have
managed to explain those errors and can't find a way out.
Let me give you an examle:
a typical error is this:
ogreroot.h(387): error C2059: syntax error : ')'
the line in question is this: void shutdown(void);
The reason for the above is this:
When i include Ruby.h before any ogre headers i get the above error
because ruby defines a shutdown macro in win32.h. So the compiler
considers shutdown as a macro.
If i include ruby.h after any ogre headers i get other kinds of errors
considering memory management functions.
e.g. Ogre defines calloc as a macro while ruby.h includes malloc.h
and declares calloc as function prototype and i get erros again.
Does anybody know a smart tactic or any advice to solve the above?
There must be a solution for all of this.
I wouldn't want to shutdown Ogre's memory management.
Thanks in advance.
Conflicts between Ogre and third party libs...
-
- Gnoblar
- Posts: 3
- Joined: Sun Jan 30, 2005 4:13 pm
-
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
katsakos, we have the same problem using ruby as our scripting language. We us an include file, that we include after including "ruby.h".
You can find it here.
This is how we use it:
I don't know if this is smart or elegant but it works.
You can find it here.
This is how we use it:
Code: Select all
#include <OgreNoMemoryMacros.h>
#include <ruby.h>
#include "FixRubyHeaders.h"
#include <OgreMemoryMacros.h>
-
- Gnoblar
- Posts: 3
- Joined: Sun Jan 30, 2005 4:13 pm