I've been searching the internet all over for 2 hours trying to fix this issue but every time I try to execute the code, it will start then about a second later it crashes with this error.
Unable to load DLL 'SDL2': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
I am completely dead on ideas. I've tried putting the .dll in references, in the main project folder, as a .cs file + "Copy to Output Directory" to "Copy if new". I've tried setting the project to x64 and x86.
Used: https://github.com/flibitijibibo/SDL2-CS also used it from NuGet.
Someone please help me.
Using Windows 10.
SDL.SDL_Init(SDL.SDL_INIT_AUDIO); // Crashes on this line
SDL.SDL_WindowFlags flags = 0;
if (resizable)
flags = SDL.SDL_WindowFlags.SDL_WINDOW_RESIZABLE;
var window = IntPtr.Zero;
window = SDL.SDL_CreateWindow(
windowTitle,
windowX,
windowY,
windowWidth,
windowHeight,
flags
);
SDL.SDL_Delay(3000);
SDL.SDL_DestroyWindow(window);
SDL.SDL_Quit();
User contributions licensed under CC BY-SA 3.0