這篇文章主要介紹了VSCode添加頭文件(C/C++)的案例分析,具有一定借鑒價(jià)值,需要的朋友可以參考下。希望大家閱讀完這篇文章后大有收獲。下面讓小編帶著大家一起了解一下。
使用VSCode編譯C/C++時(shí),會(huì)存在找不到頭文件的情況這時(shí)候需要設(shè)置兩個(gè)地方:
1.c_cpp_properites.json
2.task.json
以下是我修改的對應(yīng)的文件
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**", "${workspaceRoot}", "xxx/include" ], "browse": { "path": [ "${workspaceRoot}", "xxx/lib" ] }, "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "compilerPath": "xxx/gcc.exe", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "gcc-x64" } ], "version": 4 }