1.添加项目根目录下./vscode/c_cpp_properties.json中的includepath
参考:【VS code找不到头文件】成功解决 (检测到Include错误,请更新includePath)(明明有头文件,却找不到)_vscode找不到include-CSDN博客
2.在项目根目录下./vscode/tasks.json中,"args"参数添加-l参数,
例如:
重启vscode生效!!!!!!
需要添加多个路径这样写:
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-I",
"${workspaceFolder}\\include",
"-I",
"${workspaceFolder}\\AnotherDirectory\\include"
]
参考:
(6 封私信) VSCode改了include path仍找不到头文件是为什么? - 知乎 (zhihu.com)
版权归原作者 qq_42273272 所有, 如有侵权,请联系我们删除。