在Ubuntu20.01LTM中尝试使用VS代码设置SDL2时,我会得到以下VS代码错误:
cannot open source file "begin_code.h" (dependency of "SDL2/SDL.h")有小费吗?
发布于 2020-10-03 19:04:08
只需将"/usr/include/SDL2/"添加到c_cpp_properties.json中,如下所示:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/SDL2/"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu18",
"cppStandard": "gnu++14",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}发布于 2021-10-07 06:06:56
,以防文件夹中没有"c_cpp_properties.json“文件。
答案与上述不同,但我相信这可能是一个更好的方法。
要在工作区上创建c_cpp_properties.json,请执行以下操作:
打开命令palette)
我假设您已经在vscode上安装了扩展"C/C++ IntelliSense、调试和代码浏览“。
在这些步骤之后,这个问题为我解决了。
https://stackoverflow.com/questions/64187963
复制相似问题