I’ve been trying to build Ogre statically with a memory tracker and can’t seem to get the RTShaderSystem component to compile successfully without changing the OGRE_NEW macro.
The error occurs on lines 172 and 183 within the OgreShaderSubRenderState source file.
Code: Select all
'operator new': none of the 4 overloads could convert all the argument types
Which is activated due to the conditional located on line 368 within that same header.
It looks like the OGRE_NEW macro is only present to provide file and other location information for debugging allocations. In fact, within the 1.10.11 documentation for the OgreMemoryAllocatorConfig header file it explicitly states that the OGRE_NEW macro can be substituted for the regular new operator at the cost of losing this debugging information. I redefined the OGRE_NEW macro with the regular new operator and the RTSS compiled successfully, but I’d sooner leave that capability in place if there is a way to circumnavigate replacing OGRE_NEW with 'new'.
The documentation details for OGRE_NEW can be viewed here.
This passage in particular:
OGRE_NEW - use to allocate an object which have custom new/delete operators to handle custom allocations, usually this means it's derived from Ogre::AllocatedObject. Free the memory using OGRE_DELETE. You can in fact use the regular new/delete for these classes but you won't get any line number debugging if you do. The memory category is automatically derived for these classes; for all other allocations you have to specify it.
Lastly, is this a bug? I can’t see how any of my build settings could have caused this error from occurring outside of my decision to build with the options that made the conditional in the OgreMemoryAllocatorConfig header file on line 368 resolve to true. The OgreShaderSubRenderState source file is the only place this error occurs at when I leave the OGRE_NEW macro untouched. My only guess is that the SubRenderStateAccessor class can't find the correct overload for OGRE_NEW because it doesn't inherit from the AllocatedObject class which is where the OGRE_NEW overload is defined.
My OgreBuildSettings header is provided below.