|
-
May 28th, 2008, 03:53 PM
#1
A compiler bug?
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:
Code:
class MYDLL_API CMyClass
{
public:
virtual void AddToContainer( CMyContainer* pContainer, int nType = TYP_INVALID ) const {
assert( pContainer );
assert( nType != TYP_INVALID );
}
};
The application runs well in the Release mode, but not in the debug and ReleaseWithDebugInfo. The following error message box is displayed:
Code:
The procedure entry point ?AddToContainer@CMyClass@@UAEXPAVCMyContainer@@H@Z could not be located in the dynamic link library MyDll.dll
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).
In the nutshell, I have to add an overloaded function (non-constant this time) in the class to make it work for all cases.
Code:
virtual void AddToContainer( CMyContainer* pContainer, int nType = TYP_INVALID ) {
assert( pContainer );
assert( nType != TYP_INVALID );
}
Any ideas why this is happening? Am I missing something?
Best,
SB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|