Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/143.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 编译器错误-如何跟踪导致它的原因_C++_Compiler Errors - Fatal编程技术网

C++ 编译器错误-如何跟踪导致它的原因

C++ 编译器错误-如何跟踪导致它的原因,c++,compiler-errors,C++,Compiler Errors,首先,我如何追溯导致编译器错误的原因?我的意思是我的代码的哪一部分调用了那个错误 例如,我将VS2017与默认编译器一起使用,得到以下编译错误: C2070 'unsigned char []': illegal sizeof operand | type_traits 1227 哪一个指向标准库头type_traits,但这是毫无意义的,因为我不知道代码的哪一部分导致了它,所以如何将它追溯到代码中的原始点 现在我只看到一个选项,那就是系统地注释我的部分代码,直到我没有得到那个错误。

首先,我如何追溯导致编译器错误的原因?我的意思是我的代码的哪一部分调用了那个错误

例如,我将VS2017与默认编译器一起使用,得到以下编译错误:

C2070   'unsigned char []': illegal sizeof operand | type_traits    1227
哪一个指向标准库头
type_traits
,但这是毫无意义的,因为我不知道代码的哪一部分导致了它,所以如何将它追溯到代码中的原始点

现在我只看到一个选项,那就是系统地注释我的部分代码,直到我没有得到那个错误。必须有东西来跟踪它。

您看到的“错误”窗口(令人困惑地)只显示摘要。但是,双击该行应该会将您直接带到有问题的行


或者,查看->其他窗口->输出。错误消息还有很多内容,这显示了所有令人难以置信的细节。

请继续阅读。消息中还有大量附加注释,最终会返回到您的代码中。@PeteBecker:不在Visual Studio的错误窗口中就是这样,在
View->Other Windows->Output
中是回溯,thx alot