DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  4737 随笔 :: 2 文章 :: 542 评论 :: 1615万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

设置搜索这几个,并设置为对应值。

 

如果没解决,可能是clangd的问题。

禁用clangd,然后去看看c_cpp_properties.json。

看complierPath是不是clang。 如果是,改成g++/gcc

再看一下intelliSenseMode是不是clang。如果是,改为default。

 

linux下c_cpp_properties.json的配置

 
  1.  
    {
  2.  
    "configurations": [
  3.  
    {
  4.  
    "name": "Linux",
  5.  
    "includePath": [
  6.  
    "/usr/include",
  7.  
    "/usr/local/include",
  8.  
    "${workspaceFolder}/**"
  9.  
    ],
  10.  
    "defines": [],
  11.  
    "compilerPath": "/usr/bin/g++",
  12.  
    "cStandard": "c23",
  13.  
    "cppStandard": "c++20",
  14.  
    "browse":{"path":[
  15.  
    "/usr/include",
  16.  
    "/usr/local/include",
  17.  
    "${workspaceFolder}/**"
  18.  
    ]
  19.  
    },
  20.  
    "intelliSenseMode": "${default}"
  21.  
    }
  22.  
    ],
  23.  
    "version": 4
  24.  
    }
 
 

 

windows下c_cpp_properties.json的配置

 
  1.  
    {
  2.  
    "configurations": [
  3.  
    {
  4.  
    "name": "Win32",
  5.  
    "includePath": [
  6.  
    "D:/programme/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++",
  7.  
    "D:/programme/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/x86_64-w64-mingw32",
  8.  
    "D:/programme/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/backward",
  9.  
    "D:/programme/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/include",
  10.  
    "D:/programme/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/include-fixed",
  11.  
    "D:/programme/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/include"
  12.  
    ],
  13.  
    "defines": [
  14.  
    "_DEBUG",
  15.  
    "UNICODE",
  16.  
    "_UNICODE"
  17.  
    ],
  18.  
    "compilerPath": "D:\\programme\\mingw64\\bin\\g++.exe",
  19.  
    "cStandard": "c23",
  20.  
    "cppStandard": "c++23",
  21.  
    "intelliSenseMode": "windows-gcc-x64"
  22.  
    },
  23.  
    "version": 4
  24.  
    }
 
 

 

如果嫌vscode自带的补全太慢,可以更改以下设置(默认为10,建议改到5以下)

 

参考文章:

VSCode C/C++无法跳转到定义、自动补全、悬停提示功能

VSCode代码自动补全太慢的问题

vscode解决自动补全突然失效的问题(c++)

 
posted on   DoubleLi  阅读(1232)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2018-08-07 Jsoncpp 使用方法大全
2018-08-07 JsonCpp的简单使用方法
2018-08-07 JsonCpp使用方法详解
2018-08-07 jsoncpp解析拼装数组
2018-08-07 jsoncpp构造json字符串和json数组
2018-08-07 VS编译时使用/去除NuGet管理库
2017-08-07 [置顶][终极精简版][图解]Nginx搭建flv mp4流媒体服务器
点击右上角即可分享
微信分享提示