当前位置:网站首页>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的开发团队注意到这个问题木有。
边栏推荐
- 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
- 软件测试之发现和解决bug
- Shell script realizes multi-select DNS simultaneous batch resolution of domain name IP addresses (new update)
- Rust 从入门到精通03-helloworld
- R语言ggpubr包的ggline函数可视化分组折线图、add参数为mean_se和dotplot可视化不同水平均值的折线图并为折线图添加误差线(se标准误差)和点阵图、自定义palette设置颜色
- npm ERR! 400 Bad Request - PUT xxx - Cannot publish over previously published version “1.0.0“.
- 使用较广泛的安全测试工具有哪些?
- Use compilation to realize special effects of love
- QT专题:事件机制event基础篇
- 【云原生】快出数量级的性能是怎样炼成的?就提升了亿点点
猜你喜欢
第十七章 Excel操作
瑞吉外卖项目剩余功能补充
瑞萨RZ/G2L处理器详细测评
用了TCP协议,就一定不会丢包嘛?
使用scrapy 把爬到的数据保存到mysql 防止重复
iNFTnews | Seeing the two sides of the metaverse, what is the true Internet and the Internet of value?
DVWA Clearance Log 2 - Command Injection
要长续航还是更安全?海豹与深蓝SL03对比导购
李航《统计学习方法》笔记之朴素贝叶斯法
Rear tube implements breadcrumb function
随机推荐
Naive Bayesian Method of Li Hang's "Statistical Learning Methods" Notes
The k-nearest neighbor method in the notes of Li Hang's "Statistical Learning Methods"
List-based queuing and calling system
win10打印服务无法启动(运行时错误automation)
Implementation of mysql connection pool
Application scenarios of js anti-shake function and function throttling
Facebook自动化数据分析方案,广告投放省心省力
用汇编实现爱心特效【七夕来袭】
理解JS的三座大山
【New Edition】DeepFakes: Creation, Detection and Influence
R语言ggpubr包的ggline函数可视化分组折线图、add参数为mean_se和dotplot可视化不同水平均值的折线图并为折线图添加误差线(se标准误差)和点阵图、自定义palette设置颜色
Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’
【云原生】快出数量级的性能是怎样炼成的?就提升了亿点点
Weak yen turns game consoles into "financial products" in Japan: scalpers make big profits
Shell脚本实现多选DNS同时批量解析域名IP地址(新更新)
图形化矩阵,矩阵到底长什么样?
Re22:读论文 HetSANN An Attention-based Graph Neural Network for Heterogeneous Structural Learning
mysql进阶(二十一)删除表数据与数据库四大特性
剑指offer专项突击版第17天
使用scrapy 把爬到的数据保存到mysql 防止重复