手机谷歌浏览器登录:急,编译c++时出现如下错误,编译了多个不同文件出现同样错误 ,为此还把c++重装了n次

来源:百度文库 编辑:高考问答 时间:2024/04/29 16:27:47
Command line warning D4028 : minimal rebuild failure, reverting to normal build
ggrfh.cpp
d:\c++\ggrfh.cpp(0) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file '.\pdbmgr.cpp', line 113)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
执行 cl.exe 时出错.

ggrfh.obj - 1 error(s), 0 warning(s)
代码:
#include <iostream.h>
class Myclass
{
public :
Myclass (int x)
x=10;
private:
int x;
};
void main ()
{
Myclass My (10)
cout<<My.getnum()<<endl;
}
//不止这个代码这个毛病

My 是 Myclass类,My.getnum() 写法表示getnum() 是Myclass类的函数,但上面类的说明中没有这个函数,所以错。

如果Myclass类是从别的上级类派生出来的,getnum是上级类中的函数,则Myclass类说明要把它的来源类标上去。

如果Myclass类不是从别的类派生出来的,则要添写Myclass类的getnum()函数。

上面的错误信息字面上没什么意义,只是传达了程序有语法错误。

把你的代码贴出来看看。
总不能这样就知道什么问题嘛~~~~~

要看代码~