A setup of SDL2 with all the libraries available in the project folder.
To compile the program use:
makeTo run it:
./bin/mainTo clear compiled files:
make cleanTip
If VS Code is not detecting the path to SDL add them to the path by adding "${workspaceFolder}/include" in the Microsoft C/C++ Extension.
The Zed editor might have difficulties finding SDL2 in the include folder. To fix this, you'll need to use absolute paths in your .clangd file. To get the absolute path:
- Change directory to your project folder
- Use
pwdto get the absolute path - Create a
.clangdfile in your project root that looks similar to this:
CompileFlags:
Add:
- "-I/Users/username/Projects/my-project"
- "-I/Users/username/Projects/my-project/include"
- "-I/Users/username/Projects/my-project/include/SDL2"Replace /Users/username/Projects/my-project with the output from your pwd command.

