Hi,
I am exporting a class through a dll, which is then invoked via an application.
The class is abstract, but then concrete implementations are provided through derived classes. One of the functions of the abstract base class is causing problem that happens at the runtime. Note that compilation and linking is perfect.
The relevant portion of the class is something like:
The application runs well in the Release mode, but not in the debug and ReleaseWithDebugInfo. The following error message box is displayed:Code:class MYDLL_API CMyClass
{
public:
virtual void AddToContainer( CMyContainer* pContainer, int nType = TYP_INVALID ) const {
assert( pContainer );
assert( nType != TYP_INVALID );
}
};
When I comment out the asserts, it works for the Debug Mode, but not for the ReleaseWithDebugInfo (Which is nothing but Release build with turned off optimizations).Code:The procedure entry point ?AddToContainer@CMyClass@@UAEXPAVCMyContainer@@H@Z could not be located in the dynamic link library MyDll.dll
In the nutshell, I have to add an overloaded function (non-constant this time) in the class to make it work for all cases.
Any ideas why this is happening? Am I missing something?Code:virtual void AddToContainer( CMyContainer* pContainer, int nType = TYP_INVALID ) {
assert( pContainer );
assert( nType != TYP_INVALID );
}
Best,
SB
