I have a C++ project under Visual Studio 2010 which compiles into a dll. I have several private implementation-specific classes defined in my project, e.g. CMyClass
As Tyler Gill mentioned in the comments, this string was left by compiler due to RTTI since CMyClass
actually inherits IMyClass
and is polymorphic. My problem can be easily solved by disabling RTTI with /GR-
switch. Thanks.
As my guess from a comment appears correct, I'm reposting this as an answer.
The string of the class name is a result of having RTTI (Runtime Type Information) enabled for the compiled binaries. When RTTI is enabled, the compiler creates objects that store information about the types compiled into the binary, one of whose properties is the name of the type.
Note that some uses of dynamic_cast
and typeid
require RTTI, so disabling will cost you those features of C++.
In order to disable RTTI in Visual Studio, use the /GR-
switch (see http://msdn.microsoft.com/en-us/library/we6hfdy0(v=vs.100).aspx, as Mikhail posted.)
To disable it in GCC, use the -fno-rtti
switch.