Click to See Complete Forum and Search --> : Strange warning when compiling dll.


Magnus Ohlin
May 17th, 1999, 02:19 AM
Hiya!

I have a MFC Extension dll.

class AFX_EXT_CLASS CMyClassInDll
{
public:
CMyClassInDll();
~CMyClassInDll();

void MinMetod();
};

CMyClassInDll::CMyClassInDll()
{

}

CMyClassInDll::~CMyClassInDll()
{
}

void CMyClassInDll::MinMetod()
{
AfxMessageBox( _T("Funkade ganska bra") );
}



I have the dll in the same workspace as my main program, when I compile I get the following warnings.
'CMyClassInDll::CMyClassInDll' : inconsistent dll linkage. dllexport assumed.
'CMyClassInDll::~CMyClassInDll' : inconsistent dll linkage. dllexport assumed.
'MinMetod' : inconsistent dll linkage. dllexport assumed.

What is wrong? Everything works as i should.

Thanks
Magnus

May 20th, 1999, 03:05 PM
Hi.

Do you know if you have _AFXEXT defined in your extension DLL? This will (if I read the MSDN correctly) ensure that the AFX_EXT_CLASS is interpreted as __declspec(dllexport). I believe, that if _AFXDLL is defined and _AFXEXT is *not* defined, then the AFX_EXT_CLASS is interpreted as __declspec(dllimport).

Hope this helps.