Hi,
- Windows 10
- VS Code
- C++ MinGW 13.1.0
- SFML 2.6.1
- Makefile
I can compile and execute the app all fine, but when I try to launch or debug the cpp file (by CTRL+F5), VS Code always gives me the same error:
SFML/Graphics.hpp: No such file or directory
I have tried changing the libs to their debug versions, but to no avail.
main.cpp:
#include <SFML/Graphics.hpp>
int main()
{
//...
return 0;
}
tasks.json:
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "D:\\Prgrams\\MinGW\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
Makefile:
all: compile linkdebug
compile:
g++ -c main.cpp -I"D:\Prgrams\SFML\SFML-2.6.1\include" -DSFML_STATIC
link:
g++ main.o -o main -L"D:\Prgrams\SFML\SFML-2.6.1\lib" -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lfreetype -lwinmm -lgdi32 -mwindows
linkdebug:
g++ main.o -o main -L"D:\Prgrams\SFML\SFML-2.6.1\lib" -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lopengl32 -lfreetype -lwinmm -lgdi32 -mwindows
clean:
rm -f main *.o
Thanks in advance