We recommend using Visual Studio 2017

Compiler Error C3861


The latest version of this topic can be found at Compiler Error C3861.

identifier': identifier not found

The compiler was not able to resolve a reference to an identifier, even using argument-dependent lookup.

To fix this error, check the identifier declaration for case and spelling. Verify that scope resolution operators and namespace using directives are used correctly. If the identifier is declared in a header file, verify that the header is included before it is referenced. Also check that the identifier is not excluded by conditional compilation directives.

The following sample generates C3861.

// C3861.cpp  
void f2(){}  
int main() {  
   f();   // C3861  
   f2();   // OK  

Exception classes in the C++ Standard Library are now in the std namespace.

// C3861_b.cpp  
// compile with: /EHsc  
#include <iostream>  
int main() {  
   try {  
      throw exception("Exception");   // C3861  
      // try the following line instead  
      // throw std::exception("Exception");  
   catch (...) {  
      std::cout << "caught an exception" << std::endl;