1
我一直在尝试几个小时,我似乎无法做到这一点我已经下载了扩展程序,并寻求帮助,但在这一点上,一切都让我感到困惑。 我想在我的项目中包含SFML库,我正在尝试使用Visual Studio代码编辑器,但它仅仅因为某些原因而不符合。如何链接Visual Studio代码中的SFML库?
它目前的样子。 http://imgur.com/qJPlJua
昨天我一直在尝试这个小时,但它只是不想工作。
我一直在尝试几个小时,我似乎无法做到这一点我已经下载了扩展程序,并寻求帮助,但在这一点上,一切都让我感到困惑。 我想在我的项目中包含SFML库,我正在尝试使用Visual Studio代码编辑器,但它仅仅因为某些原因而不符合。如何链接Visual Studio代码中的SFML库?
它目前的样子。 http://imgur.com/qJPlJua
昨天我一直在尝试这个小时,但它只是不想工作。
我搜索了,我找到了。
在tasks.json文件,定义了两个任务:
"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"]
}
],
,并添加"suppressTaskName": true,
所以这就像在Linux上。
用CTRL + SHIFT + B编译。要创建.exe文件:CTRL + SHIFT + P - >然后点击“ 。
整个文件是(对我来说):
{
// 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"
}
亲切。