typedef std::list<int*> _SgSaveListType;
class
#if defined(WIN32)
_aa_DLLPORT 
#endif 
aa
{
  CCriticalSection m_cs;
  _SgSaveListType _sgprList;
int a;
}在调用aa类时,vc6提示
warning C4251: 'm_cs' : class 'CCriticalSection' needs to have dll-interface to be used by clients of class 'CMProcessDataThread'
        C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\Afxmt.h(145) : see declaration of 'CCriticalSection'..\include\MProcessDataThread.h(17) : warning C4251: '_sgprList' : class 'std::list<class CSgSave *,class std::allocator<class CSgSave *> >' needs to have dll-interface to be used by clients of class 'aa'
请问如何修改?

解决方案 »

  1.   

    加一个构造函数.__declspec( dllexport )导出它.
      

  2.   

    我的_aa_DLLPORT 是这样的
    #if !defined(aa_DLL)
    #define _aa_DLLPORT _declspec(dllimport)#else
    #define _aa_DLLPORT _declspec(dllexport)#endif请问如何封装?在哪加?
      

  3.   

    在你的程序中加入
    #pragma warning(disable:4786);
    消除调用STL出现的警告
      

  4.   

    #pragma warning(disable:4786);我已经使用了
      

  5.   

    嘿嘿
    不是看见了警告warning C4251
                  ^^^^^^^^^^^^^^   
    #pragma warning(disable:4251)这样就看不见了。