This appendix takes a Windows PC from nothing to where Chapter 1 begins: Visual Studio 2026 installed, with what C++ needs, and SDL 3 unpacked where the book expects to find it. If you've worked through Learning C++ by Building Games, you have both already, and you can go straight to Chapter 1.
There's no project to make here. Chapter 1 makes the project, points it at SDL, and opens a window at its first checkpoint, and that window is the test that everything here worked. If it doesn't open, the end of this appendix lists the message that each mistake in the setup gives, and the fix for each one.
In this appendix, we will:
- Install Visual Studio 2026, with its C++ workload
- Download SDL 3, and unpack it where every chapter expects it
- See what each of SDL's pieces is for
- Match each setup mistake to the message it gives
Both steps take a while, mostly waiting for downloads, so it's worth starting them before you sit down with Chapter 1.
Installing Visual Studio
Visual Studio is Microsoft's development environment for Windows, and its Community edition is free. Be careful with the name: Visual Studio Code is a different program, an editor, and this book's projects need Visual Studio itself. Here are the steps:
- Go to https://visualstudio.microsoft.com/, and download Visual Studio 2026 Community.
- Run the installer. When it shows its list of workloads, check Desktop development with C++.
- Click Install, and let it finish. It downloads several gigabytes, so this can take a while.
The workload is the one choice that matters. It brings the C++ compiler, the linker, and Windows' own headers and libraries. Without it, nothing in this book can build.
Downloading SDL 3
SDL is a library for games. It opens the window, reads the keyboard and the mouse, draws, and plays sound. And it does them the same way on Windows, on a Mac and on Linux, so a game's own code doesn't have to know which it's on. This book was built with SDL 3.4.4, and any later 3.x release will do. Here are the steps:
- Go to https://github.com/libsdl-org/SDL/releases. In the newest SDL 3 release, find the list of downloads, labeled Assets (click Show all if the list is cut short), and download the file whose name ends in
-VC.zip, such asSDL3-devel-3.4.4-VC.zip. It's the version of SDL made for Visual C++, ready to use. The files called Source code are SDL's own code, which you'd have to build yourself. - Right-click the zip, choose Extract All, change the destination to
C:\, and click Extract. Then rename the new folder, which has a name likeC:\SDL3-3.4.4, to plainSDL3. - Check that
C:\SDL3holds anincludefolder and alibfolder, with no other folder in between, and thatC:\SDL3\lib\x64holdsSDL3.libandSDL3.dll.
Step 3 matters more than it looks. Every chapter's project settings say C:\SDL3\include and C:\SDL3\lib\x64, so an extra folder in between, such as C:\SDL3\SDL3-3.4.4\include, leaves the compiler unable to find anything.
What Each Piece Is For
SDL comes in three pieces, and each is for a different part of building and running a game:
- The headers, in
C:\SDL3\include\SDL3, are for the compiler. They declare SDL's functions and types, so that code such asSDL_Init(SDL_INIT_VIDEO)can be checked and compiled. - The import library,
SDL3.lib, is for the linker. It doesn't hold SDL's code, only a note of each function's name, and that it's to be found inSDL3.dll. - The DLL,
SDL3.dll, holds SDL's code itself. Windows loads it when the game starts, from beside the game's program, or from the folder the game is started in.
Chapter 1's project settings tell the compiler where the headers are, and the linker where the import library is, and which one to use. Then a copy of the DLL goes in the project's folder, the folder that Visual Studio starts the game in. SDL3_ttf, which Chapter 1 adds partway through, comes in the same three pieces, and goes in the same way.
The lib folder has three folders inside it, one for each kind of Windows PC: x64 for the usual 64-bit PC, x86 for old 32-bit Windows, and arm64 for PCs with ARM processors. This book builds for x64, which is what Visual Studio chooses for a new project.
If Something Goes Wrong
Each message here is exactly what Visual Studio 2026 prints, at Chapter 1's first checkpoint, when one part of SDL's setup is missing. The fix for each is in the project's properties, which Chapter 1's setup steps open: right-click the project, choose Properties, and set Configuration to All Configurations and Platform to All Platforms before changing anything.
C1083: Cannot open include file: 'SDL3/SDL.h': No such file or directory, in main.cpp. The compiler can't find SDL's headers. Check that C/C++ > General > Additional Include Directories says C:\SDL3\include. Then look in the folder itself: it should hold a folder called SDL3, with SDL.h inside, not a folder with a version number in its name.
LNK1104: cannot open file 'SDL3.lib'. The linker knows which file it wants, but not where it is. Check that Linker > General > Additional Library Directories says C:\SDL3\lib\x64.
LNK2019: unresolved external symbol SDL_Init referenced in function SDL_main, with one like it for every SDL function the game calls, and then LNK1120: 15 unresolved externals. The linker can't find SDL's code, because it hasn't been told to use SDL3.lib. Check that Linker > Input > Additional Dependencies has SDL3.lib. The SDL_main in the message is main, renamed behind the scenes by SDL_main.h, and the number in LNK1120 grows as the game calls more of SDL.
The same LNK2019 messages, with an underscore before every name, as in _SDL_Init, and LNK4272: library machine type 'x64' conflicts with target machine type 'x86'. The game is being built for 32-bit Windows, and SDL's library is for 64-bit. Set the platform dropdown in the toolbar, beside Debug, to x64.
A message box says "The code execution cannot proceed because SDL3.dll was not found." The game built, but Windows couldn't find the DLL it needs to start it. Copy SDL3.dll from C:\SDL3\lib\x64 into the project folder, beside src. The Output window reports the same problem as a program that "exited with code -1073741515 (0xc0000135)."
Chapters 1 to 4 build, and then Chapter 5 gives C7589: defaulting comparison operators requires at least '/std:c++20', in Common.h, with C7525: inline variables require at least '/std:c++17', in Monster.h, and C2676: binary '!=': 'Point' does not define this operator or a conversion to a type acceptable to the predefined operator, in main.cpp. The project is still using Visual Studio's own choice of C++, C++14, which the code outgrows in Chapter 5. Set C/C++ > Language > C++ Language Standard to ISO C++20 Standard (/std:c++20).
The game builds in Debug, but in Release it gives one of the messages above. The settings were made with Configuration set to Debug, so Release has none of them, and Chapter 27 is the first to build in Release. Make them again, with Configuration set to All Configurations.
With SDL in place, you're ready for Chapter 1, and its first window.
