尽管存在许多错误,但VC6.0仅显示一个编译错误 [英] VC6.0 only show one compile error in spite of there are many errors

查看:128
本文介绍了尽管存在许多错误,但VC6.0仅显示一个编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我的VC6.0存在问题:
当我编译存在许多语法错误的代码时,构建结果始终是这样的:

Hi all!
There is a problem with my VC6.0:
When I compile code in which there are many syntax errors,the build result is always like that:

XXX.exe - 1 error(s), 0 warning(s)


但是,所有错误都可以在结果上方列出,并且当您单击它们时,您也可以照常查找代码行.仅错误数量会被错误地计算;
我该如何解决这个问题?欢迎任何回应!


例如,下面的代码有一些语法错误:


However all the errors can be listed above the result and when you clicked them you can also locate the code line as usual.Only the error quantity is counted wrongly;
How can I solve the problem ? Any response is welcomed!


For example,the code below has some syntax errors:

#include <iostream>
using namespace std;

int main()
{
    int a = 1,b = 2,,;
    printf("a + b = %d",a + b);

    return "OK";
}



但是编译结果是:

G:\代码\程序实践\ C ++ \ VC_TEXT \ main.cpp(6):错误C2059:语法错误:'',''
G:\代码\程序实践\ C ++ \ VC_TEXT \ main.cpp(9):错误C2440:返回":无法从"char [3]"转换为"int"
这种转换需要reinterpret_cast,C样式的强制转换或函数样式的强制转换
G:\ Code \ Program Practice \ C ++ \ VC_TEXT \ main.cpp(10):警告C4508:"main":函数应返回一个值;假定为"void"返回类型
执行cl.exe时出错.

VC_TEXT.exe-1个错误,0个警告

错误数量是错误的.应该是3,而不是1



But the compile result is:

G:\Code\Program Practice\C++\VC_TEXT\main.cpp(6) : error C2059: syntax error : '',''
G:\Code\Program Practice\C++\VC_TEXT\main.cpp(9) : error C2440: ''return'' : cannot convert from ''char [3]'' to ''int''
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
G:\Code\Program Practice\C++\VC_TEXT\main.cpp(10) : warning C4508: ''main'' : function should return a value; ''void'' return type assumed
Execute cl.exe 时出错.

VC_TEXT.exe - 1 error(s), 0 warning(s)

the error quantity is wrong.It should be 3 rather than 1

推荐答案

分层错误.修复该错误后,您将收到另一个错误.
Hierarchical errors. After fixing that error, you will receive another error.


这篇关于尽管存在许多错误,但VC6.0仅显示一个编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆