在我的macOS VSCode,写一个main.cpp 文件代码:
但是这里有:
检测到 #include 错误。请更新 includePath。已为此翻译单元(/Users/john/Desktop/Test/Test-demos/test-cpp-demos/cpp-demo-01/main.cpp)禁用波形曲线。C/C++(1696)
无法打开 源 文件 "iostream". 请运行“选择 IntelliSense 配置...”命令以定位系统标头。C/C++(1696)
'iostream' file not found
VSCode中需要配置:
.vscode/c_cpp_properties.json
也就是说确保:
includePath 里面的path 是可以进行找到 C++ 标准库的。