VSCode使用

使用VSCode

c_cpp_properties.json添加Include Paths

Ctrl+Shift+P可以调出控制窗口
再输入edit或者configuration,选择"C/Cpp:Edit Configurations":
然后就出来了。 

 1 {
 2     "configurations": [
 3         {
 4             "name": "Linux",
 5             "includePath": [
 6                 "${workspaceFolder}/**",
 7                 "/home/wmz/darknet/**"
 8             ],
 9             "defines": [],
10             "compilerPath": "/usr/bin/gcc",
11             "cStandard": "c11",
12             "cppStandard": "c++17",
13             "intelliSenseMode": "clang-x64"
14         }
15     ],
16     "version": 4
17 }

只有下面这一句是我添加的:

1  "/home/wmz/darknet/**"

这个是配置路径使用的,之前直使用:

 "/home/wmz/darknet/src/**"

 之前一直报找不到头文件,是因为有些文件在src文件夹之外。

原文地址:https://www.cnblogs.com/juluwangshier/p/11739918.html