Compiler Error C2871


For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

'name' : a namespace with this name does not exist

This error will occur when you pass an identifier that is not a namespace to a using directive.

The following sample generates C2871:

// C2871.cpp  
// compile with: /c  
using namespace d;   // C2871 d is not a namespace  
using namespace System;   // OK