为何会有内部编译错误?

来源:百度知道 编辑:UC知道 时间:2024/05/25 04:14:04
我在类String中声明了友元函数:
friend String operator + (const String &, const String &);
结果出现如下错误:
--------------------Configuration: 高级继承 - Win32 Debug--------------------
Compiling...
友元函数和运算符重载.cpp
D:\Program Files\Microsoft Visual Studio\MyProjects\高级继承\友元函数和运算符重载.cpp(18) : 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
执行 cl.exe 时出错.

友元函数和运算符重载.obj - 1 error(s), 0 warning(s)

请问这是怎么回事?
谢谢!

friend std::String operator + (const std::String &, const std::String &);
或者在头文件下面加上一句
using namespace std;
如果不是这个问题。可以加我百度HI。我给你分析下。

加上using namespace std;