解决linuxdeployqt报错——系统版本过新的问题
参考文章:https://icode.best/i/45016240865860
目前测试有效
大概你会跳转到这个议题
issues#340
显示这样类似的报错
linuxdeployqt 5 (commit fc64c50), build 609 built on 2019-01-06 03:55:18 UTC
Please run on a system no newer than the oldest still-supported Ubuntu LTS release.
This is so that the resulting bundle can run on all still-supported releases of Ubuntu.
嘛,就是嫌弃你系统新,没事,这有个好办法。
解决办法#
暴力改源代码,来,跟着我学着做。
git clone https://github.com/probonopd/linuxdeployqt.git
cd ./linuxdeployqt/tools/linuxdeployqt
vim main.cpp # 这里可以选你自己喜欢的编辑器
然后大约在203行,找到
// openSUSE Leap 15.0 uses glibc 2.26 and is used on OBS
// Ubuntu Xenial (16.04) uses glibc 2.23
// Ubuntu Bionic (18.04) uses glibc 2.27
if (strverscmp (glcv, "2.28") >= 0) {
qInfo() << "ERROR: The host system is too new.";
qInfo() << "Please run on a system with a glibc version no newer than what comes with the oldest";
qInfo() << "currently still-supported mainstream distribution (Ubuntu Bionic), which is glibc 2.27.";
qInfo() << "This is so that the resulting bundle will work on most still-supported Linux distributions.";
qInfo() << "For more information, please see";
qInfo() << "https://github.com/probonopd/linuxdeployqt/issues/340";
return 1;
}
这个就是罪魁祸首,你可以注释掉它,删了也行,随便你。
这里用的是改数字的方式,把2.28改成10。(我自己当时是直接删了)
然后就在这个目录执行
cd ./../../ #跳转到项目根目录
cmake .
cmake --build .
cd ./tool/linuxdeployqt
./linuxdeployqt -v
当然,你可以这样安装。
在linuxdeployqt所在的目录,执行
cp ./linuxdeployqt /usr/local/bin/linuxdeployqt
这样就大功告成了
作者:leedsgarden
出处:https://www.cnblogs.com/leedsgarden/p/16440516.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库