Re: Setting up SFML (Simple and Fast Multimedia Library) in Visual Studio Code (VSCode)
Step 5: Create tasks.json for Build Configuration
Inside the .vscode folder, create a file called tasks.json.
Paste the following configuration, adjusting the paths to match your SFML installation:
{
"version": "2.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "g++",
"args": [
"-g",
"${workspaceFolder}/main.cpp",
"-o",
"${workspaceFolder}/main.exe",
"-I", "C:/SFML/include",
"-L", "C:/SFML/lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"],
"detail": "Compiles SFML program using g++"
}
]
}
Adjust "C:/SFML/include" and "C:/SFML/lib" to match the actual location of your SFML installation.