- Install CMake
- Install the 'CMake' and 'CMake Tools' extensions in VSCode
- In the extension settings for 'CMake Tools', set the 'Generator' to be 'MinGW Makefiles'.
- Compile SFML and CMake (see guide online / other info on here)
- Copy CMakeLists.txt into the project you want to use SFML with
- Modify variables in CMakeLists.txt, like the main cpp file, etc.
- In VSCode, ctrl+shift+P->Cmake:Configure->Select proper compiler
- Build file should be created by step 4, paste the dll files from the SFML bin folder in there
- If your code compiles correctly but doesn't run, it could be because the dll files are not present with the executable
- Click the "Build" and "Run" buttons at the bottom of the screen in VSCode to build and run the file
- If Build doesn't work, try running cmake -G"MinGW Makefiles" . first
These guides may be helpful: