CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    19

    Strange warning when compiling dll.

    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


  2. #2
    Guest

    Re: Strange warning when compiling dll.

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured