bash: ../configure: /bin/sh^M: bad interpreter: No such file or directory

bash: ../configure: /bin/sh^M: bad interpreter: No such file or directory

这个错误通常是由于Windows平台下的文本格式导致的,而在Linux下则会被解释为错误。解决这个问题的方法之一是使用dos2unix命令将脚本转换为Unix格式。

dos2unix ../configure

然后重新运行配置步骤:

../configure \ -opensource \ -confirm-license \ -release \ -prefix /usr/local/Qt \ -nomake examples \ -nomake tests

Creating qmake... .g++: error: unrecognized debug output level '\x0d' '; did you mean '-fdata-sections'? make: *** [Makefile:250: main.o] Error 1

这也是由于在windows平台下执行Linux编译的文本格式错误 (一般是因为用了虚拟机) 解决方法是

在 Qt 源码的根目录下运行以下命令:

find /home/ubuntu2004/qt-everywhere-src-5.15.8 -type f -exec dos2unix {} \;

递归清理其中的文本格式问题

然后重新运行./configure命令

相关推荐
OOJO15 分钟前
c++---list介绍
c语言·开发语言·数据结构·c++·算法·list
笨笨饿2 小时前
29_Z变换在工程中的实际意义
c语言·开发语言·人工智能·单片机·mcu·算法·机器人
艾为电子2 小时前
【技术帖】让接口不再短命:艾为 C-Shielding™ Type-C智能水汽防护技术解析
c语言·开发语言
棉花骑士3 小时前
【AI Agent】面向 Java 工程师的Claude Code Harness 学习指南
java·开发语言
IGAn CTOU3 小时前
PHP使用Redis实战实录2:Redis扩展方法和PHP连接Redis的多种方案
开发语言·redis·php
环黄金线HHJX.3 小时前
TSE框架配置与部署详解
开发语言·python
Vfw3VsDKo3 小时前
Maui 实践:Go 接口以类型之名,给 runtime 传递方法参数
开发语言·后端·golang
Pyeako4 小时前
PyQt5 + PaddleOCR实战:打造桌面级实时文字识别工具
开发语言·人工智能·python·qt·paddleocr·pyqt5
白藏y5 小时前
【C++】muduo接口补充
开发语言·c++·muduo
zk_one5 小时前
【无标题】
开发语言·前端·javascript