I just added SDL2 via CMake and am experiancing unknown behavior. After adding SDL to my library and only including the SDL2/SDL.h file, my program immediately crashes with no error.
- Download SDL2-devel-2.28.5-mingw.zip from release-2.28.5 and unpack to contents to <project_root>/deps/SDL2.
- Added the following to my CMakeLists.txt:
target_link_libraries(mylib PUBLIC SDL2::SDL2main SDL2::SDL2)
- Build project, results successful.
- Include the SDL/SDL2.h header in my source code somewhere without any SDL2 specific code (eg SDL_Init)
- Run the program, get
Process finished with exit code -1073741515 (0xC0000135).
There is no error/stack trace to explain what is going on. I can only assume it is either a result of my cmake configuration or there is something going on the SDL2 that I don’t understand.
Any assistance would be greatly appreciated.
Also note that it took me several hours just to get to this point as the simple instructions in the SDL2 repo are short and I feel leave a lot of explanation of setup out.