How do you install SDL2.0.7 64bit version onto Visual Studio 2017 on Window 10?

This is a question. I am able to get the x86 version to work, but not the x64 version. Can someone clear up how to hook SDL2 x64 to Visual Studio 2017 on Windows 10 for 64bit graphics?

Thanks in advance.

I’m not entirely sure what you are asking. Are you using the development libraries from the libsdl.org website or are you building SDL2 yourself? The latter works for me on Windows 10 and Visual Studio 2017.

This article, How to Set Up SDL with Visual Studio 2017, covers the setup of the x86 version of SDL2, but try doing the same with the x64 version, and it won’t work.

So how does one hookup the x64 version of SDL2?

When you create a Visual Studio 2017 Project, it should have properties for two platforms targets (x86/Win32 and x64). If you have not configured the x64 platform yet, do the same steps for it as with x86 except the following: Use the lib/x64 directory instead of lib/x86 for the path that goes into Additional Library Directories.

It’s also necessary to copy the SDL2.dll from the lib/x64 directory to the Output Directory. By default, Visual Studio 2017 creates two different output directories for the platforms. They should look like this:

  • x86: ProjectDirectory/Debug or ProjectDirectory/Release.
  • x64: ProjectDirectory/x64/Debug or ProjectDirectory/x64/Release.

You can of course change this on the General page of the project properties if you want to have it look differently.

Hope that makes it work. Otherwise, post any error message you get here.

1 Like

I found the problem in ‘Configuration Manager’ in the project ‘Properties’. There I saw one can change the project from x86 or x64. So now it is working in 64 bit mode.

Thanks much for your aid.

for some reason one project is requiring me to put the SDL2.dll(x64 version) file into the code folder (yourproject/yourproject/…) rather than simply in the project folder (yourproject/…). Looks like its working great, thanks.