致命错误C1001:内部编译器错误 [英] fatal error C1001: INTERNAL COMPILER ERROR
问题描述
编译......
overlaod.cpp
d:\ vc work \ cpp \think_in_cpp \chapter10 \overlaod.cpp(17):致命错误
C1001:内部编译器错误
(编译器文件''msc1.cpp'',第1786行)
请选择技术支持命令在Visual C ++
帮助菜单上,或打开技术支持帮助文件获取更多信息
信息
执行cl.exe时出错。
overlaod.obj - 1个错误,0个警告
编译时,上面的错误将是apear。我是C ++的新手,我希望
有人在这里可以帮助我。以下是我的源代码
#include< iostream>
使用命名空间std;
class myOverload
{
public:
myOverload(float a,浮动b)
{
x = a;
y = b;
}
myOverload operator =(const myOverload qq)
{
return myOverl oad(x = qq.x,y = qq.y);
}
朋友const myOverload运算符+(const myOverload& m,const
myOverload& n);
void myprint()
{
cout<< 这是一个复杂的:\ n << x<< " + QUOT; << y<< " I" <<结束;
}
私人:
浮动x;
浮动y;
};
myOverload const运算符+(const myOverload& m,const myOverload& n)
{
返回myOverload (mx + nx,我+ ny);
}
int main()
{
myOverload AA(1.3f,2.6f);
myOverload BB(1.7f,0.4f);
myOverload CC = AA + BB;
CC.myprint();
返回0;
}
Compiling...
overlaod.cpp
d:\vc work\cpp\think_in_cpp\chapter10\overlaod.cpp(17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file ''msc1.cpp'', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.
overlaod.obj - 1 error(s), 0 warning(s)
when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code
#include <iostream>
using namespace std;
class myOverload
{
public:
myOverload(float a, float b)
{
x = a;
y = b;
}
myOverload operator=(const myOverload qq)
{
return myOverload(x = qq.x, y = qq.y);
}
friend const myOverload operator+(const myOverload &m, const
myOverload &n);
void myprint()
{
cout << "here is a complex: \n" << x << "+" << y << "i" << endl;
}
private:
float x;
float y;
};
myOverload const operator+(const myOverload &m, const myOverload &n)
{
return myOverload(m.x + n.x, m.y + n.y);
}
int main()
{
myOverload AA(1.3f, 2.6f);
myOverload BB(1.7f, 0.4f);
myOverload CC = AA + BB;
CC.myprint();
return 0;
}
推荐答案
LZXIA写道:
编译......
overlaod.cpp
d:\ vc work\cpp\think_in_cpp \ chapter10 \\ overlaod.cpp(17):致命错误
C1001:内部编译器错误
(编译器文件''msc1.cpp'',第1786行)
请在Visual上选择技术支持命令C ++
帮助菜单,或打开技术支持帮助文件以获取更多信息>执行cl.exe时出错。
overlaod.obj - 1个错误,0个警告
编译时,上面的错误会出现问题。我是新手在C ++中,我希望有人在这里可以帮助我。以下是我的源代码
内部错误通常与您的代码无关。尝试编译
最小程序(即int main(){})并查看错误是否仍然存在。你可能需要重新安装你的编译器。
#include< iostream>
使用命名空间std;
class myOverload
{
public:
myOverload(float a,float b)
{
x = a;
y = b;
}
myOverload operator =(const myOverload qq)
{
返回myOverload(x = qq.x,y = qq.y);
}
朋友const myOverload operator +(const myOverload& m,const
myOverload& n);
void myprint()
{
cout<< 这是一个复杂的:\ n << x<< " + QUOT; << y<< " I" <<私有:
浮动x;
浮动y;
};
myOverload const运算符+(const myOverload& m ,const myOverload& n)
{
返回myOverload(mx + nx,我的+ ny);
}
{
myOverload AA(1.3f,2.6f);
myOverload BB(1.7f,0.4f);
myOverload CC = AA + BB;
CC.myprint();
返回0;
}
Compiling...
overlaod.cpp
d:\vc work\cpp\think_in_cpp\chapter10\overlaod.cpp(17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file ''msc1.cpp'', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.
overlaod.obj - 1 error(s), 0 warning(s)
when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code
Internal error usually has nothing to do with your code. Try to compile
a minimum program (ie. int main(){}) and see if the error persist. You
might need to reinstall your compiler.
#include <iostream>
using namespace std;
class myOverload
{
public:
myOverload(float a, float b)
{
x = a;
y = b;
}
myOverload operator=(const myOverload qq)
{
return myOverload(x = qq.x, y = qq.y);
}
friend const myOverload operator+(const myOverload &m, const
myOverload &n);
void myprint()
{
cout << "here is a complex: \n" << x << "+" << y << "i" << endl;
}
private:
float x;
float y;
};
myOverload const operator+(const myOverload &m, const myOverload &n)
{
return myOverload(m.x + n.x, m.y + n.y);
}
int main()
{
myOverload AA(1.3f, 2.6f);
myOverload BB(1.7f, 0.4f);
myOverload CC = AA + BB;
CC.myprint();
return 0;
}
你的代码在我的机器上用g ++和cl编译得很好。
问候,
Ben
Your code compiled fine with both g++ and cl on my machine.
Regards,
Ben
我认为我的VC6.0中肯定存在一些问题。谢谢。
I think there must be some probelm in my VC6.0. Thanks.
LZXIA写道:
我认为我的VC6.0中肯定存在一些问题。谢谢。
I think there must be some probelm in my VC6.0. Thanks.
很多!它也很老了。
-
Ian Collins。
Many! It''s also very old.
--
Ian Collins.
这篇关于致命错误C1001:内部编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!