且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Visual Studio Code 中链接 SFML 库?

更新时间:2023-01-19 11:03:20

我知道这个话题已经有几年了,但是因为我一直在寻找一种在 vs 代码中链接 sfml 库的方法,所以我第一次来到这里,我想我会分享我发现的这个 git repo,到目前为止它对我来说效果很好:

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-样板

不过,我没有使用 SFML 2.5.1,所以我不得不对 c_cpp_properties.json 文件进行一些小的更改(我使用的是 Ubuntu 18.04 并通过包管理器安装了 sfml)

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)

这里是我的 c_cpp_properties.json 文件:

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
}