FIX: You receive error message when a "using namespace std" directive is placed before friend operator (192539)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q192539 SYMPTOMS
When a "using namespace std" directive is placed before a friend operator
declaration, you may get one of the following two errors:
Case 1
error C2248: [member variable name] : cannot access private member
declared in class [class name] [file name] (line number) : see
declaration of [member variable]
Case 2
[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.
CAUSE
The friend operator resolution fails in the compiler front-end when std
namespace is introduced.
RESOLUTIONA 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)
WORKAROUNDDo one of the following to work around this problem:
- Move the "using namespace std" directive after the friend operator
declaration.
- Avoid using the "using namespace std" directive.
- Forward declare the operator and/or class.
STATUSMicrosoft 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:
194022
Visual Studio 6.0 service packs, what, where, why
194295 How to tell that a Visual Studio service pack is installed
Modification Type: | Minor | Last Reviewed: | 10/7/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbQFE kbBug kberrmsg kbfix kbLangCPP kbVS600sp3fix KB192539 kbAudDeveloper |
---|
|