I downloaded Ogre3D source code, and found this kind of class declaration:
class _OgreExport TimeIndex
{ ...
I know "TimeIndex" is the class name, but what is the "_OgreExport" in the middle? CPP reference doesn't include this kind of class declaration form. What is this?
It's a macro that expands to something like
__declspec(dllexport)
, marking the class to be exported by the linker._OgreExport
is a preprocessor directive that expands to eitherwhen the file is included outside its module or
otherwise. Under Windows, you have to specify which classes/methods you want exported/imported so that they can be used across binaries.
Technically, as James pointed out in the comments, the macro name is illegal, since it begins with an underscore. These names are reserved for the implementation.
see this code from OgrePlatform.h:138
I highly recommend using google code search if you have further questions of this type. Just enter, e.g., _OgreExport and see how other used it or how it is defined.