Im on Ubuntu 22.04.4 LTS, and im getting into using the SDL2 library, but for some reason running SDL_Quit() gives me a segmentation fault. Heres the minimum amount of code for which the error occurs:
1 #include <SDL2/SDL.h> 2 3 int main(void) { 4 5 SDL_Init(SDL_INIT_VIDEO); 6 SDL_Window *screen = SDL_CreateWindow("test", 100, 100, 680, 550, 0); 7 8 SDL_DestroyWindow(screen); 9 SDL_Quit(); 10 return 0; 11 }
If i dont run SDL_CreateWindow it works for some reason. I ran it in gdb and backtraced it, it seems the error occured in a function called ___pthread_mutex_lock. Does anyone have any idea what is happening here? Could it be something with my graphics drivers?
Marc Mennes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.