error MSB6006: “CL.exe” exited with code 2

后端 未结 9 1698
刺人心
刺人心 2020-12-31 04:42

I\'m writing with visual c++ and when I compile this error occures:

C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Platforms\\Win32\\Microsoft.Cpp.Wi         


        
9条回答
  •  悲&欢浪女
    2020-12-31 05:36

    I get this bug in v110 (Visual studio 2012)-Compiler with the following code, which contains a wrong for-based loop.

    class A
    {
        int b;
    };
    
    int main(int argc, char* argv[])
    {
        A inst;
    
        for (auto &i : inst)
        {
    
        }
    
        return 0;
    }
    

    PS: v140 (Visual Studio 2015) shows the correct error:

    error C3312: no callable 'begin' function found for type 'A'
    error C3312: no callable 'end' function found for type 'A'
    

提交回复
热议问题