I have been trying to get SFML work in VS code for two days but no luck. I have tried different guides but non has proven helpful, so I decided to try it by my self.
Quick Info:
- Windows 10 64x
- minGW compiler
- GCC 7.3.0 MinGW (DW2) - 32-bit
- Visual Studio code v. 1.29.1
My c_cpp_properties.json:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/SFML-2.5.1/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "gcc-x64",
"browse": {
"path": [
"C:/SFML-2.5.1/include"
]
}
}
],
"version": 4
}
My tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "g++",
"args": [
"-g",
"main.cpp",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "silent"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
}
I have tried to use the same commands a linux user is supposed to use in terminal, in my case powershell but got errors:
> gcc .\main.cpp -o test.exe -I"\SFML-2.5.1\include\" -lsfml-graphics -lsfml-window -lsfml-sy
stem
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-graphics
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-window
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-system
collect2.exe: error: ld returned 1 exit status
Do someone know how I can make this work?