当前位置:网站首页>MSYS2 QtCreator Clangd 代码分析找不到 mm_malloc.h的问题补救
MSYS2 QtCreator Clangd 代码分析找不到 mm_malloc.h的问题补救
2022-08-02 09:59:00 【丁劲犇】
近期学校的机房里升级了msys2,遇到了QtCreator的代码提示问题,不算完全解决,因为要上课,采用了临时的补救方法。
1. 现象
升级msys2 msys64, 发现QtCreator clangd 解析代码出现问题,提示找不到mm_malloc.h,类似:
In include file : 'mm_malloc.h' file not found

虽然不影响编译调试,但是很不爽。
2. 初步解决
这个错误现象很诡异。clangd 是一种分析器,理应自动查找头文件。打开文件夹,发现mm_malloc.h是存在的,且就在clang的文件夹下。

问题应该出在clangd的配置上。clangd在分析第三方编译器(比如gcc)的工程时,不会关联clang的include,因此导致这个问题。正确的解决办法是为clangd人为指定路径,但一时半会找不到配置文件放在哪里。查看clangd的帮助,应该写到一个配置中。这样吧,先用内建的代码分析器,关闭clangd选项:
3.进一步解决
初步解决后,分析报错没有了,但是少了不少有益的提示。
我们在gcc的include文件夹内建立一个空白的mm_malloc.h,关联到真实的mm_malloc.h。如果是Linux,支持链接就太棒了。windows下,还是写include吧。
//mm_malloc.h in mingw64/include
#include "../lib/clang/14.0.4/include/mm_malloc.h"
如此设置后,打开clangd选项,原有故障不再出现。
4.不足
此种方法,在升级clang后,显然是无法工作的。因为clang的include路径有14.0.4这个版本号。这个问题应该是由使用clang分析gcc的工程导致的。解铃还须系铃人,不知道Qt for msys2的开发团队注意到这个问题木有。
边栏推荐
- 超赞!发现一个APP逆向神器!
- R语言ggpubr包的ggbarplot函数可视化分组柱状图、设置add参数为mean_se可视化不同水平均值的柱状图并为柱状图添加误差线(se标准误差)、position参数自定义分组柱状图分离
- Use the scrapy to climb to save data to mysql to prevent repetition
- R language ggplot2 visualization: use the ggbarplot function of the ggpubr package to visualize the stacked bar plot, the lab.pos parameter specifies the position of the numerical label of the bar cha
- Long battery life or safer?Seal and dark blue SL03 comparison shopping guide
- 一款优秀的中文识别库——ocr
- R language ggplot2 visualization: based on the fill parameter and shape parameter in the aes function, custom draw a grouped line chart and add data points (scatter points), use the legend.position fu
- 高效时代,电商运营如何靠RPA快速提效?
- C语言volatile关键字、内嵌汇编volatile与编译器的爱恨情仇
- 使用较广泛的安全测试工具有哪些?
猜你喜欢

神通数据库,批量插入数据的时候失败

享年94岁,图灵奖得主、计算复杂性理论先驱Juris Hartmanis逝世

向量点积(Dot Product),向量叉积(Cross Product)

李航《统计学习方法》笔记之k近邻法

Rear tube implements breadcrumb function

Using the TCP protocol, will there be no packet loss?

Use compilation to realize special effects of love

利用二维数据学习纹理三维网格生成(CVPR 2020)

牛客刷题——剑指offer(第三期)

食品安全 | 鱼肝油不是鱼油,家有宝宝的注意了
随机推荐
Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’
You Only Hypothesize Once: 用旋转等变描述子估计变换做点云配准(已开源)
List-based queuing and calling system
DirectX修复工具增强版「建议收藏」
wireshark的安装教程(暖气片安装方法图解)
从零开始入门单片机(一):必会背景知识总结
Smoothing of time series data in R language: smoothing time series data to remove noise using the dpill function and locpoly function of the KernSmooth package
Re23:读论文 How Does NLP Benefit Legal System: A Summary of Legal Artificial Intelligence
mysql连接池的实现
软件测试的基本理论知识(软件测试面试基础知识)
MySql千万级分页优化,快速插入千万数据方法
开源一夏 | GO语言框架中如何快速集成日志模块
干货|如何在海量文件系统中选择合适自己的文件系统
【新版干货书】深度伪造 (DeepFakes):创造,检测和影响
armv7与armv8的区别(v8和w12的区别)
Spearman's correlation coefficient
一文带你了解推荐系统常用模型及框架
Linux system uninstall, install, upgrade, migrate clickHouse database
One Summer of Open Source | How to Quickly Integrate Log Modules in GO Language Framework
Chapter 15 Generics