mac#include
时间: 2023-10-29 17:07:54 浏览: 65
Mac台中的#include路径可以通过编辑配置文件c_cpp_properties.json来进行设置。你可以按下command+shift+p,选择C/C++编辑配置(JSON),将输出的路径信息拷贝到c_cpp_properties.json文件中的includePath数组中。具体的操作步骤如下:
1. 按下command+shift+p,选择C/C++编辑配置(JSON)。
2. 打开c_cpp_properties.json文件。
3. 在configurations数组中添加一个新的配置,比如"Mac"。
4. 在该配置下的includePath数组中添加路径信息:
"${workspaceFolder}/**",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c/v1",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
5. 保存文件。
这样就可以设置Mac平台的#include路径了。