Simple program with errors

I am new to SDL and C++. Can someone here explain why I get these errors?

#include <SDL2/SDL.h>
#include <stdio.h>

int main()
{
if (SDL_Init(SDL_INIT_VIDEO) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}

SDL_Quit();
}

shorthello.cpp:7:2: error: ?cout? is not a member of ?std?
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
^
shorthello.cpp:7:55: error: ?endl? is not a member of ?std?
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
^

You need to #include to use std::cout.On 04/03/15 00:02, bilsch01 wrote:

I am new to SDL and C++. Can someone here explain why I get these errors?

#include <SDL2/SDL.h>
#include <stdio.h>

int main()
{
if (SDL_Init(SDL_INIT_VIDEO) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}

SDL_Quit();
}

shorthello.cpp:7:2: error: ?cout? is not a member of ?std?
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
^
shorthello.cpp:7:55: error: ?endl? is not a member of ?std?
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
^