我的 Mac 上的 VS Code 会产生头文件和第三方库(本例中为wxWidgets )的#include 错误。我阅读了我能找到的所有内容,调整了“c_cpp_properties.json”中的“includePath”设置,但没有任何帮助。
\n头文件与 .cpp 文件位于同一文件夹中(“/src/”)。该项目构建并运行良好,但 VS Code 产生 #include 错误,并且错误曲线覆盖了我的整个项目。
\n下面是屏幕截图和带有 VS Code 设置的 JSON 文件。
\n\nc_cpp_properties.json:
\n{\n "configurations": [\n {\n "name": "Mac",\n "includePath": [\n "${workspaceFolder}/src",\n "${workspaceFolder}/**",\n "/usr/local/Cellar/wxmac/3.0.5.1/include/wx-3.0"\n ],\n "defines": [],\n "macFrameworkPath": [\n "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"\n ],\n "compilerPath": "/usr/bin/g++",\n "cStandard": "c11",\n "cppStandard": "c++17"\n }\n ],\n "version": 4\n}\nRun Code Online (Sandbox Code Playgroud)\n请帮我解决这个问题。
\n\xe2\x80\x94\xe2\x80\x94\xe2\x80\x94\xe2\x80\x94\xe2\x80\x94更新\xe2\x80\x94\xe2\x80\x94\xe2\x80\x94\ xe2\x80\x94\xe2\x80\x94
\n建议我在c_cpp_properties.json中使用以下设置:
\n{\n "configurations": [\n {\n "name": …Run Code Online (Sandbox Code Playgroud)