The #include exists, but I get an error: identifier “cout” is undefined. Why?
You need to specify the std:: namespace: Alternatively, you can use a using directive: I should add that you should avoid these using directives in headers, since code including these will also have the symbols brought into the global namespace. Restrict using directives to small scopes, for example Here, the using directive only applies to the scope of foo().