I get this error for my IntelliSense in VS Code:
cannot open source file "barrier" (dependency of "role_server.h") C/C++(1696)
I also have this issue for #include <experimental/coroutine>
, but I believe this was included in the same C++ standard, so fixing the barrier should hopefully lead to the fix for "cannot open source file experimental/coroutine"
Barrier was included in c++ standard 20 and I configured c_cpp_properties.json to use that standard.
This is what the file currently looks like.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/**",
"/usr/local/include/**",
"~/INSTALL/protobuf/src",
"${workspaceFolder}"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c23",
"cppStandard": "c++20",
"intelliSenseMode": "linux-gcc-x86",
"configurationProvider": "ms-vscode.makefile-tools",
"compilerArgs": [
"-std=c++20"
]
}
],
"version": 4
}
For reference, I use Bazelisk for building the executable and I don't run into any issues there, so it's just a VS Code configuration question.
Additionally, I have tried other strategies like changing my compilerPath
and intelliSenseMode
. I use Linux 20.04.1-Ubuntu.