Ubuntu Qt: ninja: build stopped:subcommand failed解决方案
ninja
a small build system with a focus on speed
项目地址:https://gitcode.com/gh_mirrors/ni/ninja

·
Ubuntu Qt: ninja: build stopped:subcommand failed解决方案
编译Qt源码时,出现报错:
ninja: build stopped:subcommand failed
滑动终端上的编译日志,通过日志上的**FAILED:**信息可以查看是编译哪个库导致的失败.
我的报错信息是:
FAILED: not found qtbase/bin/lupdate
结果反复测试,最终发现qtbase/bin目录下的lupdate文件在编译时总是自动消失,继续查看日志,最后发现:
undefined reference to `typeinfo for clang::ASTFrontendAction
undefined reference to `typeinfo for clang::ASTConsumer
undefined reference to `typeinfo for clang::DiagnosticConsumer
undefined reference to `typeinfo for clang::PPCallbacks
报错原因:
因为Qt需要LLVM来生成qdoc. 在Ubuntu中通过安装包或者源码安装的LLVM,LLVM/Clang默认是禁用RTTI.
解决方案 1:
不需要生成qdoc, 那么在配置configure时增加-no-feature-clang, 没有实际验证过, 需要自行测试.
./configure -no-feature-clang
解决方案 2:
通过源码重装LLVM, 参考M1 arm环境 - Ubuntu 22.04 源码安装LLVM, 重装完成LLVM后,继续执行命令,继续编译Qt:
cmake --build . --parallel 2
亲测会继续编译Qt 剩余未编译部分, 不要重新执行 ./configure
比较稳妥流程:
rm -rf CmakeCache.txt
./configure
cmake --build . --parallel 2
sudo cmake --install .




a small build system with a focus on speed
最近提交(Master分支:8 个月前 )
04175abf
Add support for cgroup2 in CPU quota parsing 22 天前
cb857086 - 24 天前
更多推荐
所有评论(0)