Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) 'cout' is not a member of 'std'

 

Compile error.

 

 

 

 

 

Full error message

 

[C++ Error] Unit1.htm(3): E2316 'cout' is not a member of 'std'

 

 

 

 

 

Cause

 

IDE: C++ Builder 6.0

Compiler: Borland BCC32.EXE version 6.0.10.157

Project type: Console Application

 

int main()
{
  std::cout << "Hello world" << std::endl;
}

 

 

 

 

 

Solution

 

The compiler does not know the function 'cout'. Add the header file so it does:

 

#include <iostream>

int main()
{
  std::cout << "Hello world" << std::endl;
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict