我在Windows上的Visual Studio Code中的C程序中使用MPI。我可以在WSL中编译并运行它,但VSCode警告我找不到mpi.h
:
我已经在WSL中安装了libopenmpi-dev
,并将标头目录添加到VSCode的设置(.vscode/c_cpp_properties.json
)中:
{
"configurations": [
{
"name": "WSL",
"includePath": [
"${workspaceFolder}/**",
"/usr/lib/gcc/x86_64-linux-gnu/7/include",
"/usr/local/include",
"/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": [
"${workspaceFolder}/**",
"/usr/lib/gcc/x86_64-linux-gnu/7/include",
"/usr/local/include",
"/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
包括stdio.h
之类的标准标头没有问题。如何使VSCode找到mpi.h
?