SDL2.dll 32/64-bit usage question

Heya, I think I have a misunderstanding around how 32/64 bit features interact.

I have 32-bit minGW and SDL2 installed through MSYS on a 64-bit Windows system. Should I include the 32 or 64-bit SDL2.dll in my project? I expected to need 32-bit to match the MSYS installs, but I seem to only get proper behavior with 64-bit.

Probably an obvious answer, but I wanted to double check since I didn’t find issues until I started using particular parts of the library (e.g. threading).


The SDL2.dll must match your project.
If you build your project as a 32bit .exe, you must use the 32bit SDL2.dll, if you build it as 64bit .exe, you must use the 64bit SDL2.dll - otherwise the program won’t start.

On 32bit Windows only a 32bit .exe will work, on 64bit windows both 32 and 64bit executables work.

If I recall correctly, MSYS has different shells for building 32bit and 64bit programs, so which SDL2.dll you need will depend on which MSYS shell you’re using.

1 Like