Setting Up SDL2 for Visual Studio 2022

Matthew Clark
Nerd For Tech
Published in
3 min readJul 3, 2024

I have been learning SDL recently and decided I should make a short tutorial on how to get it up and running in visual studio.

First download the SDL zip file. It should be the one labeled SDL2-devel-version-VC.zip.

Unzip the file somewhere on your computer where you know where it is located.

Create a new project in visual studio and add main.cpp.

Now right-click the project and go to properties.

Go to VC++ Directories ->Include Directories

Click the drop down and select edit. Click the folder icon and then the three dots to browse your files.

Locate the SDL files and select the include folder.

Navigate to the Library Directories and go through the same process to select the lib file. Select the correct lib between x64 and x86 for the current project.

Now navigate to Linker -> Input -> Additional Dependencies.

Select edit and add this SDL2.lib;SDL2main.lib;.

Now locate the dll file in your SDL lib files.

Copy this and add it to the folder that contains you main.cpp file.

Now we are ready to start coding. If you have done everything correctly this code will create a window.

--

--