用MFC AppWizard创建了一个SDI程序。
在View中添加了定义:
CArray<CPoint,CPoint> m_aBody;
没有添加其它。在编译时却提示出错:
error C2143: syntax error : missing ';' before '<'
error C2501: 'CArray' : missing storage-class or type specifiers
error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'
请问这是什么原因?
解决方法:
添加下面一行代码:
#include "afxtempl.h"