fork download
  1. #include <SDL2/SDL.h>
  2. #include <iostream>
  3.  
  4.  
  5.  
  6. int main() {
  7. int retval;
  8. if( (retval = SDL_Init(SDL_INIT_VIDEO)) < 0 ) {
  9. std::cout << "SDL_Init returned " << retval << ": " << SDL_GetError() << std::endl;
  10. return -1;
  11. }
  12.  
  13. SDL_Window * window = SDL_CreateWindow(
  14. "test",
  15. SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
  16. 640, 480,
  17. 0
  18. );
  19. if(window == nullptr) {
  20. std::cout << "SDL_CreateWindow returned nullptr: " << SDL_GetError() << std::endl;
  21. return -1;
  22. }
  23.  
  24.  
  25. bool quit = false;
  26. SDL_Event event;
  27.  
  28. while(quit == false)
  29. while(SDL_PollEvent(&event))
  30. if(event.type == SDL_QUIT)
  31. quit = true;
  32.  
  33.  
  34. SDL_DestroyWindow(window);
  35. SDL_Quit();
  36.  
  37. return 0;
  38. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:22: fatal error: SDL2/SDL.h: No such file or directory
 #include <SDL2/SDL.h>
                      ^
compilation terminated.
stdout
Standard output is empty