跟着孙鑫老师的vc++视频教程做,做到第十一课的时候,遇到一个问题,就是打开vc++6.0的安装路径然后打开里面的SRC中的viewcore.cpp文件,然后继续跟着教程做,编译的时候提示四个错误四个警告,分别如下:
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(25) : error C2491: 'CView::messageMap' : definition of dllimport static data member not allowed
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(501) : warning C4273: 'protected: static struct AFX_MSGMAP const CCtrlView::messageMap' : inconsistent dll linkage.  dllexport assumed.
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(501) : error C2491: 'CCtrlView::messageMap' : definition of dllimport static data member not allowed
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(563) : warning C4273: 'public: static struct CRuntimeClass const CSplitterWnd::classCSplitterWnd' : inconsistent dll linkage.  dllexport assumed.
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(563) : error C2491: 'CSplitterWnd::classCSplitterWnd' : definition of dllimport static data member not allowed
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(564) : warning C4273: 'public: static struct CRuntimeClass const CCtrlView::classCCtrlView' : inconsistent dll linkage.  dllexport assumed.
d:\program files\microsoft visual studio\vc98\mfc\src\viewcore.cpp(564) : error C2491: 'CCtrlView::classCCtrlView' : definition of dllimport static data member not allowed
Error executing cl.exe.VIEWCORE.OBJ - 4 error(s), 4 warning(s)错误大概出现在:
BEGIN_MESSAGE_MAP(CView, CWnd)    //提示这一行错误
//{{AFX_MSG_MAP(CView)
ON_WM_PAINT()
ON_WM_MOUSEACTIVATE()
ON_WM_CREATE()
ON_WM_DESTROY()BEGIN_MESSAGE_MAP(CCtrlView, CView)      //这一行错误
ON_WM_PAINT()
END_MESSAGE_MAP()IMPLEMENT_DYNAMIC(CSplitterWnd, CWnd)   // for swap tuning   //这一行有错误
IMPLEMENT_DYNAMIC(CCtrlView, CView)   //这一行错误