undefined reference to ‘std::cout’
Compile the program with: as cout is present in the C++ standard library, which would need explicit linking with -lstdc++ when using gcc; g++ links the standard library by default. With gcc, (g++ should be preferred over gcc)