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

January 8, 2018 · View on GitHub

 

 

 

 

 

(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; }