0


vscode 找不到头文件 No such file or directory

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)

标签: vscode ide 编辑器

本文转载自: https://blog.csdn.net/qq_42273272/article/details/138822869
版权归原作者 qq_42273272 所有, 如有侵权,请联系我们删除。

“vscode 找不到头文件 No such file or directory”的评论:

还没有评论