#include "stdafx.h"
#include <list>typedef list<int, allocator<int>> intlist;int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
intlist c;
return 0;
}搞了很长时间了,请教大家!谢谢!

解决方案 »

  1.   

    增加#include <afxtempl.h>
      

  2.   

    加入#include <afxtempl.h>这个头文件
    MFC 提供 6 个 template classes:CArray,
    CList,
    CMap,
    CTypedPtrArray,
    CTypedPtrList,
    CTypedPtrMap
      

  3.   


    template list 好像是c++库里就带的吧,我不想用mfc,有没有其他办法呢?而且现在还是编译不通过,提示" WINDOWS.H already included."
      

  4.   

    typedef std::list<int>intlist;