Re: Strane linker errors when exporting DLL that uses ADO
<muybluie@hotmail.com> wrote:
In a different DLL, I link with the the LIB for the above code,
and attempt to use 'B'. However, I get an 'unresolved external'
linker error for 'B::method'. The weird thing is that if I
change the method to not be virtual, or if I change the
parameter to not be a RecordsetPtr, the code links successfully.
It seems like the combination of a virtual method and an ADO
recordset does not work.
What gives?
Did you introduce the MSADO namespace (or whataever name is
generated by the #import directive) in the different DLL? Try to
use fully qualified name for ADO classes (i.e., with namespace):
class __declspec(dllexport) A
{
//All kinds of stuff
virtual method( MSADO::_RecordsetPtr rs );
};
class __dclspec(dllexport) B : public A
{
//override
virtual method( MSADO::_RecordsetPtr rs );
};
Also, I assume you have a proper macro instead of the
"__dclspec(dllexport)" specifier, which expands either to
"dllexport" or "dllimport" according to the project settings.
Alex