When a "using namespace std" directive is placed before a friend operator
declaration, you may get one of the following two errors:
error C2248: [member variable name] : cannot access private member
declared in class [class name] [file name] (line number) : see
declaration of [member variable]
[file name](line number) : 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.
The friend operator resolution fails in the compiler front-end when std
namespace is introduced.
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Service Pack 3 for Visual Studio 6.0 that contains this hotfix.
To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note
In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
The English version of this fix should have the following file attributes or later:
Date Time Size File Name Version# Platform
9/15/98 08:26p 1,183,795 C1xx.dll 12.00.8257.0 (x86)
Do one of the following to work around this problem:
- Move the "using namespace std" directive after the friend operator
- Avoid using the "using namespace std" directive.
- Forward declare the operator and/or class.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:
Visual Studio 6.0 service packs, what, where, why
How to tell that a Visual Studio service pack is installed