When calling SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
the window is not created and calling SDL_GetError returns an error that reads exactly as shown in the title. I had set my SDL_VIDEODRIVER to 'windows' at one point, but changing this, rebuilding my application, and attempting to run again did not change the error. I did not find any documentation about the error, even in a couple of directories listing SDL error codes. I am on Eclipse C++ and my compiler is cygwin. Why am I getting this error, and how do I solve it? Is there any other information I need to provide to get to the bottom of this?
Edit: Here is the minimum reproducible example:
#define SDL_MAIN_HANDLED
#include <iostream>
#include <SDL.h>
using namespace std;
int main() {
//This if statement's condition is not met. I left it here in its full form to
//show that SDL_Init() is not causing the error.
if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
SDL_Quit();
return 1;
}
//It seems as though win is being set to nullptr here.
SDL_Window *win = SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
//This if statement's condition is met. The error is written to the console from this cout statement.
if (win == nullptr){
cout << "SDL_CreateWindow Error: " << SDL_GetError();
SDL_Quit();
return 1;
}
return 0;
}