[Solved] Cannot Compile OGRE3DRenderSystem under VC9

martintamare

24-09-2009 09:45:33

NxOgre compile fine but when it comes to OGRE3DRenderSystem I've got this :

d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(308) : warning C4003: not enough actual parameters for macro 'max'
2>d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(308) : error C2589: '(' : illegal token on right side of '::'
2>d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(308) : error C2059: syntax error : '::'
2>d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(348) : error C2589: '(' : illegal token on right side of '::'
2>d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(348) : error C2143: syntax error : missing ')' before '::'
2>d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(348) : error C2661: 'Ogre::Math::Sqrt' : no overloaded function takes 0 arguments
2>d:\apps\dev\librairie\nxogre\rendersystems\ogre\ogre3drenderable.cpp(348) : error C2059: syntax error : ')'

Reporting to this lines of code :
----------------------------
if (mProfile.usesIndexes)
{
OgreAssert(indexCount <= std::numeric_limits<unsigned short>::max(), "indexCount exceeds 16 bit");
----------------------------

----------------------------
Ogre::Real OGRE3DRenderable::getBoundingRadius(void) const
{
return Ogre::Math::Sqrt(std::max(mBox.getMaximum().squaredLength(), mBox.getMinimum().squaredLength()));
}
----------------------------

Ogre : v1.6.3
PhysX SDK : 2.8.1
PhysX Runtimes : 9.09.0203

Everytime, the max function is involved, so I guess it maybe due to something about that ...

Regards,

Anthony

PS : sorry for my non native english ...

martintamare

24-09-2009 09:55:28

I put

#define NOMINMAX

on top of OGRE3DRenderable.cpp and it compiles ok (but with warnings)

betajaen

24-09-2009 10:31:55

The warnings are okay.

Sometimes NOMINMAX is required due to the Windows headers stupidly declaring "min" and "max" as macros. I'm surprised Ogre would bring in the Windows headers though.