在vscode下找到.vscode-->c_cpp_xxx.json
找到
"cppStandard": "c++14"
改为
"cppStandard": "c++17"
若是修改之后还是无法补全,可以尝试:
1.重启scode
2.检查安装的插件(我是多安装了一个个人开发的CMake)
3.在cpp_xxx.json文件中添加"home/(用户名)/(demo名)/src/(包名)/devel/include"
"home/xin/hello/src/pub_sub/devel/include",
"home/xin/hello/devel/include",
![请输入图片描述][1] [1]: https://easy.xinin.top/i/2023/02/20/kj56a6.png