CTypedPtrArray<CObArray,CLine*>m_LineArray;//管理直线对象指针的对象并且我在stdafx.h中已经加了头文件:#include <afxtempl.h>  
为什么还是有错:error C2143: syntax error : missing ';' before '<'
error C2501: 'CTypedPtrArray' : missing storage-class or type specifiers
error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'哪位高手指点一下啦

解决方案 »

  1.   

    CLine类文件在定义这个CTypedPtrArray之前include 了吗
      

  2.   

    看起来好像是afxtempl.h它没找到。
      

  3.   

    因为头文件中并没有包含stdafx.h,所以在头文件前面直接加上#include <afxtempl.h>
    #include "line.h"
      

  4.   

    可能是包含你定义CTypedPtrArray的那个头文件的那个cpp文件没有包含stdafx.h哈哈,这个说得好长,不知道你看懂了没有换成在头文件中包含,像楼上说得那样~~
      

  5.   

    谢谢了,确实是没找着afxtempl.h。
      

  6.   

    谢谢了,确实是没找着afxtempl.h。