example:pragma warning(disable:4786)#include <iostream>
#include <string>
#include <map>using namespace std;

解决方案 »

  1.   

    pragma warning(disable:4786)#include <iostream>
    #include <string>
    #include <map>
    #include <list>using namespace std;
      

  2.   

    pragma warning(disable:4786)
    using namespace std;
    是什么意思?
    必须加吗?
      

  3.   

    还是不对:
    --------------------Configuration: CodeCom - Win32 Debug--------------------
    Compiling...
    CodeCounter.cpp
    d:\codecounter\codecom\codecounter.h(11) : error C2146: syntax error : missing ';' before identifier 'warning'
    d:\codecounter\codecom\codecounter.h(11) : error C2501: 'pragma' : missing storage-class or type specifiers
    d:\codecounter\codecom\codecounter.h(11) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.CodeCom.dll - 3 error(s), 0 warning(s)
      

  4.   

    pragma warning(disable:4786)//使用stl会出现大量的4786警告,最好不要显示
    using namespace std;//所用的变量均在名字空间std中定义
      

  5.   

    sorryshould be 
    #pragma warning(disable:4786)
      

  6.   

    还是有同样的错误:
    --------------------Configuration: CodeCom - Win32 Debug--------------------
    Compiling...
    CodeCounter.cpp
    d:\codecounter\codecom\codecounter.h(47) : error C2143: syntax error : missing ';' before '<'
    d:\codecounter\codecom\codecounter.h(47) : error C2501: 'list' : missing storage-class or type specifiers
    d:\codecounter\codecom\codecounter.h(47) : error C2059: syntax error : '<'
    d:\codecounter\codecom\codecounter.h(47) : error C2238: unexpected token(s) preceding ';'
    Error executing cl.exe.CodeCom.dll - 4 error(s), 0 warning(s)
      

  7.   

    list <int> m_listIndex; //test.
      

  8.   

    你是不是把“#include <list>”写成“#include <list.h>”了?