How do i link the SFML libraries in Visual Studio Code?
I've been trying for hours and I can't seem to do it I've downloaded extensions and asked for help around but everything is just confusing me at this point.
I want to include the SFML libs in my project and I'm trying to use the the Visual Studio Code editor for it but it just won't comply for some reason.
A picture of what it currently looks like.
http://imgur.com/qJPlJua
I've been trying this for hours yesterday also but it just doesn't want to work.
sfml visual-studio-code
add a comment |
I've been trying for hours and I can't seem to do it I've downloaded extensions and asked for help around but everything is just confusing me at this point.
I want to include the SFML libs in my project and I'm trying to use the the Visual Studio Code editor for it but it just won't comply for some reason.
A picture of what it currently looks like.
http://imgur.com/qJPlJua
I've been trying this for hours yesterday also but it just doesn't want to work.
sfml visual-studio-code
add a comment |
I've been trying for hours and I can't seem to do it I've downloaded extensions and asked for help around but everything is just confusing me at this point.
I want to include the SFML libs in my project and I'm trying to use the the Visual Studio Code editor for it but it just won't comply for some reason.
A picture of what it currently looks like.
http://imgur.com/qJPlJua
I've been trying this for hours yesterday also but it just doesn't want to work.
sfml visual-studio-code
I've been trying for hours and I can't seem to do it I've downloaded extensions and asked for help around but everything is just confusing me at this point.
I want to include the SFML libs in my project and I'm trying to use the the Visual Studio Code editor for it but it just won't comply for some reason.
A picture of what it currently looks like.
http://imgur.com/qJPlJua
I've been trying this for hours yesterday also but it just doesn't want to work.
sfml visual-studio-code
sfml visual-studio-code
asked Jul 15 '16 at 20:37
JasonJason
1613
1613
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
I searched and I have finded.
In the tasks.json file, define two tasks :
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
and add "suppressTaskName": true,
So it's like on Linux.
You compile with CTRL + SHIFT + B. For create the .exe file : CTRL+SHIFT+P --> then "run task" then click then click on the "Liaison du fichier compilé aux
bibliothèques SFML" task.
the entire file is as (for me):
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
"showOutput": "always"
}
Cordially.
add a comment |
I know this question is about two years old, but after fiddling with my own tasks to solve this problem, and came up with something. This shouldn't be the best way to do it, but this should be good for anyone that finds this answer in the future.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Compile",
"type": "shell",
"group": "build",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileBasenameNoExtension}.exe",
"-IC:\SFML-2.5.1\include",
"-LC:\SFML-2.5.1\lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system",
],
"problemMatcher": [
"$gcc"
]
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
//"showReuseMessage": true
}
}
This should work the same as the above answer. Hit CTRL+SHIFT+B to bring up the Task prompt, or look up Run task
in the Command Palette (CTRL+SHIFT+P). Remember to have the .dlls of each library used in the root of the project.
Hope this helps.
add a comment |
I know the topic is a couple years old now but since I was searching for a way to link the sfml lib in vs code and I first ended up here, I thought I would share this git repo I found, which works pretty well for me so far:
https://github.com/andrew-r-king/sfml-vscode-boilerplate
I'm not using SFML 2.5.1 though, so I had to bring a small change in the c_cpp_properties.json file (I am on Ubuntu 18.04 and installed sfml through package manager)
here my c_cpp_properties.json file:
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/src",
"/usr/local/include/**",
"/usr/include/**"
],
"defines": ,
"cStandard": "c11",
"cppStandard": "c++17",
"forcedInclude": [
"${workspaceFolder}/src/PCH.hpp"
]
}
],
"version": 4
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38404670%2fhow-do-i-link-the-sfml-libraries-in-visual-studio-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I searched and I have finded.
In the tasks.json file, define two tasks :
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
and add "suppressTaskName": true,
So it's like on Linux.
You compile with CTRL + SHIFT + B. For create the .exe file : CTRL+SHIFT+P --> then "run task" then click then click on the "Liaison du fichier compilé aux
bibliothèques SFML" task.
the entire file is as (for me):
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
"showOutput": "always"
}
Cordially.
add a comment |
I searched and I have finded.
In the tasks.json file, define two tasks :
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
and add "suppressTaskName": true,
So it's like on Linux.
You compile with CTRL + SHIFT + B. For create the .exe file : CTRL+SHIFT+P --> then "run task" then click then click on the "Liaison du fichier compilé aux
bibliothèques SFML" task.
the entire file is as (for me):
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
"showOutput": "always"
}
Cordially.
add a comment |
I searched and I have finded.
In the tasks.json file, define two tasks :
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
and add "suppressTaskName": true,
So it's like on Linux.
You compile with CTRL + SHIFT + B. For create the .exe file : CTRL+SHIFT+P --> then "run task" then click then click on the "Liaison du fichier compilé aux
bibliothèques SFML" task.
the entire file is as (for me):
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
"showOutput": "always"
}
Cordially.
I searched and I have finded.
In the tasks.json file, define two tasks :
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
and add "suppressTaskName": true,
So it's like on Linux.
You compile with CTRL + SHIFT + B. For create the .exe file : CTRL+SHIFT+P --> then "run task" then click then click on the "Liaison du fichier compilé aux
bibliothèques SFML" task.
the entire file is as (for me):
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "Compilation",
"isBuildCommand": true,
"args": ["-c", "${workspaceRoot}\main.cpp", "-IC:\SFML-2.4.0\include"]
},
{
"taskName": "Liaison du fichier compilé aux bibliothèques SFML",
"args": ["${workspaceRoot}\main.o", "-o", "sfml-app.exe", "-LC:\SFML-2.4.0\lib", "-lsfml-graphics", "-lsfml-window", "-lsfml-system"]
}
],
"showOutput": "always"
}
Cordially.
answered Sep 26 '16 at 18:30
Thomas LegerThomas Leger
113
113
add a comment |
add a comment |
I know this question is about two years old, but after fiddling with my own tasks to solve this problem, and came up with something. This shouldn't be the best way to do it, but this should be good for anyone that finds this answer in the future.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Compile",
"type": "shell",
"group": "build",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileBasenameNoExtension}.exe",
"-IC:\SFML-2.5.1\include",
"-LC:\SFML-2.5.1\lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system",
],
"problemMatcher": [
"$gcc"
]
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
//"showReuseMessage": true
}
}
This should work the same as the above answer. Hit CTRL+SHIFT+B to bring up the Task prompt, or look up Run task
in the Command Palette (CTRL+SHIFT+P). Remember to have the .dlls of each library used in the root of the project.
Hope this helps.
add a comment |
I know this question is about two years old, but after fiddling with my own tasks to solve this problem, and came up with something. This shouldn't be the best way to do it, but this should be good for anyone that finds this answer in the future.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Compile",
"type": "shell",
"group": "build",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileBasenameNoExtension}.exe",
"-IC:\SFML-2.5.1\include",
"-LC:\SFML-2.5.1\lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system",
],
"problemMatcher": [
"$gcc"
]
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
//"showReuseMessage": true
}
}
This should work the same as the above answer. Hit CTRL+SHIFT+B to bring up the Task prompt, or look up Run task
in the Command Palette (CTRL+SHIFT+P). Remember to have the .dlls of each library used in the root of the project.
Hope this helps.
add a comment |
I know this question is about two years old, but after fiddling with my own tasks to solve this problem, and came up with something. This shouldn't be the best way to do it, but this should be good for anyone that finds this answer in the future.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Compile",
"type": "shell",
"group": "build",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileBasenameNoExtension}.exe",
"-IC:\SFML-2.5.1\include",
"-LC:\SFML-2.5.1\lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system",
],
"problemMatcher": [
"$gcc"
]
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
//"showReuseMessage": true
}
}
This should work the same as the above answer. Hit CTRL+SHIFT+B to bring up the Task prompt, or look up Run task
in the Command Palette (CTRL+SHIFT+P). Remember to have the .dlls of each library used in the root of the project.
Hope this helps.
I know this question is about two years old, but after fiddling with my own tasks to solve this problem, and came up with something. This shouldn't be the best way to do it, but this should be good for anyone that finds this answer in the future.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Compile",
"type": "shell",
"group": "build",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileBasenameNoExtension}.exe",
"-IC:\SFML-2.5.1\include",
"-LC:\SFML-2.5.1\lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system",
],
"problemMatcher": [
"$gcc"
]
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
//"showReuseMessage": true
}
}
This should work the same as the above answer. Hit CTRL+SHIFT+B to bring up the Task prompt, or look up Run task
in the Command Palette (CTRL+SHIFT+P). Remember to have the .dlls of each library used in the root of the project.
Hope this helps.
answered Nov 13 '18 at 17:11
KaidenKaiden
111
111
add a comment |
add a comment |
I know the topic is a couple years old now but since I was searching for a way to link the sfml lib in vs code and I first ended up here, I thought I would share this git repo I found, which works pretty well for me so far:
https://github.com/andrew-r-king/sfml-vscode-boilerplate
I'm not using SFML 2.5.1 though, so I had to bring a small change in the c_cpp_properties.json file (I am on Ubuntu 18.04 and installed sfml through package manager)
here my c_cpp_properties.json file:
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/src",
"/usr/local/include/**",
"/usr/include/**"
],
"defines": ,
"cStandard": "c11",
"cppStandard": "c++17",
"forcedInclude": [
"${workspaceFolder}/src/PCH.hpp"
]
}
],
"version": 4
}
add a comment |
I know the topic is a couple years old now but since I was searching for a way to link the sfml lib in vs code and I first ended up here, I thought I would share this git repo I found, which works pretty well for me so far:
https://github.com/andrew-r-king/sfml-vscode-boilerplate
I'm not using SFML 2.5.1 though, so I had to bring a small change in the c_cpp_properties.json file (I am on Ubuntu 18.04 and installed sfml through package manager)
here my c_cpp_properties.json file:
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/src",
"/usr/local/include/**",
"/usr/include/**"
],
"defines": ,
"cStandard": "c11",
"cppStandard": "c++17",
"forcedInclude": [
"${workspaceFolder}/src/PCH.hpp"
]
}
],
"version": 4
}
add a comment |
I know the topic is a couple years old now but since I was searching for a way to link the sfml lib in vs code and I first ended up here, I thought I would share this git repo I found, which works pretty well for me so far:
https://github.com/andrew-r-king/sfml-vscode-boilerplate
I'm not using SFML 2.5.1 though, so I had to bring a small change in the c_cpp_properties.json file (I am on Ubuntu 18.04 and installed sfml through package manager)
here my c_cpp_properties.json file:
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/src",
"/usr/local/include/**",
"/usr/include/**"
],
"defines": ,
"cStandard": "c11",
"cppStandard": "c++17",
"forcedInclude": [
"${workspaceFolder}/src/PCH.hpp"
]
}
],
"version": 4
}
I know the topic is a couple years old now but since I was searching for a way to link the sfml lib in vs code and I first ended up here, I thought I would share this git repo I found, which works pretty well for me so far:
https://github.com/andrew-r-king/sfml-vscode-boilerplate
I'm not using SFML 2.5.1 though, so I had to bring a small change in the c_cpp_properties.json file (I am on Ubuntu 18.04 and installed sfml through package manager)
here my c_cpp_properties.json file:
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/src",
"/usr/local/include/**",
"/usr/include/**"
],
"defines": ,
"cStandard": "c11",
"cppStandard": "c++17",
"forcedInclude": [
"${workspaceFolder}/src/PCH.hpp"
]
}
],
"version": 4
}
answered Jan 5 at 16:45
GrybouilliGrybouilli
14
14
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38404670%2fhow-do-i-link-the-sfml-libraries-in-visual-studio-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown