当前位置:网站首页>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的开发团队注意到这个问题木有。
边栏推荐
- This article takes you to understand the commonly used models and frameworks of recommender systems
- 软件测试与质量 之白盒测试
- 你认同这个观点吗?大多数企业的数字化都只是为了缓解焦虑
- armv7与armv8的区别(v8和w12的区别)
- Linux system uninstall, install, upgrade, migrate clickHouse database
- 关于缓存数据的探讨
- 新“内卷”席卷科技圈,Google CEO 要求 174000 员工提高工作效率!
- QT专题:事件机制event基础篇
- Linux系统卸载,安装,升级,迁移clickHouse数据库
- 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助你玩转抖音,开启电商运营新引擎

超赞!发现一个APP逆向神器!

Naive Bayesian Method of Li Hang's "Statistical Learning Methods" Notes

SAP 云平台上一种 Low Code Development(低代码开发)解决方案

The k-nearest neighbor method in the notes of Li Hang's "Statistical Learning Methods"

npm ERR! 400 Bad Request - PUT xxx - Cannot publish over previously published version “1.0.0“.

leetcode 62. Unique Paths(独特的路径)

Application scenarios of js anti-shake function and function throttling
随机推荐
链表的实现
斯皮尔曼相关系数
二维数组零碎知识梳理
iNFTnews | 看见元宇宙的两面,何谓全真互联网和价值互联网?
R language ggplot2 visualization: use the ggbarplot function of the ggpubr package to visualize the horizontal column chart (bar chart), use the orientation parameter to set the column chart to be tra
Long battery life or safer?Seal and dark blue SL03 comparison shopping guide
软件测试H模型
net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。
yolov7创新点
wireshark的安装教程(暖气片安装方法图解)
读博一年后对机器学习工程的思考
单词接龙 II
The love-hate relationship between C language volatile keyword, inline assembly volatile and compiler
未知内容监控
瑞吉外卖项目剩余功能补充
【OpenCV】-霍夫变换
R语言ggpubr包的ggbarplot函数可视化分组柱状图、设置add参数为mean_se可视化不同水平均值的柱状图并为柱状图添加误差线(se标准误差)、position参数自定义分组柱状图分离
利用二维数据学习纹理三维网格生成(CVPR 2020)
你认同这个观点吗?大多数企业的数字化都只是为了缓解焦虑
周鸿祎称微软抄袭 360 安全模式后发文否认;英特尔CEO基辛格回应市值被AMD超越:股价下跌是咎由自取|极客头条...