description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2871 |
Compiler Error C2871 |
11/04/2016 |
|
|
44aeb84d-61f0-45e0-8dad-22a3cd46b7f8 |
'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
namespace a {
int fn(int i) { return i; }
}
namespace b {
using namespace d; // C2871 because d is not a namespace
using namespace a; // OK
}