I'm trying to install and include SFML into my VS Code and I am a absolute beginner as well. I looked up several videos on this topic but it wont help.
The code I am trying to run is a sample code from the SFML Website.
This is my task.json:
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: cpp.exe Aktive Datei kompilieren",
"command": "C:\\MinGW\\bin\\cpp.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"-O2",
"-DNDEBUG",
"-ggdb",
"-pedantic-errors",
"-Werror",
"-Wall",
"-Weffc++",
"-Wextra",
"-Wsign-conversion",
"-std=c++20",
"-Wconversion",
"-IC:\\Users\\amirf\\Documents\\libraries\\SFML-2.5.1\\include\\SFML",
"-LC:\\Users\\amirf\\Documents\\libraries\\SFML-2.5.1\\lib",
"-lsfml-window",
"-lsfml-graphics",
"-lsfml-system",
"-lsfml-audio",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Vom Debugger generierte Aufgabe."
}
],
"version": "2.0.0"
}
However if I try to include a sfml library, I always get: fatal error: SFML/Graphics.hpp: No such file or directory
I looked up other questions posted in stack overflow about that topic but all helpful answer where to include the paths in the task.json which I asume I already did
-Ioption is pretty dumb: compiler will take yourincludestatement and first search directly for that file, then it will append the included file to each entry in-Ioption. You addedinclude\SFMLto your include path, so it will try to look forC:\\Users\\amirf\\Documents\\libraries\\SFML-2.5.1\\include\\SFML\\SFML/Graphics.hpp. Either#include "Graphics.hpp"directly or change your include path to...\\SFML-2.5.1\\includeGraphics.hppon your system?