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命令

相关推荐
想要入门的程序猿12 小时前
Qt插件QPluginLoader
开发语言·qt
Rabitebla12 小时前
C++11 新特性详解(一):列表初始化、initializer_list 与右值引用
java·开发语言·数据结构·c++·算法·leetcode·list
洋不写bug12 小时前
JavaComparable、Comparator、Cloneable接口解析,深拷贝浅拷贝详细解析
android·java·开发语言
吴声子夜歌12 小时前
正则指引——Golang
开发语言·golang·正则表达式
坐吃山猪13 小时前
WebFlux_学习Subscriber总结
java·开发语言·学习·webflux
白露与泡影13 小时前
Java面试题及答案整理(2026年金九银十最新版,持续更新)
java·开发语言
少控科技13 小时前
农场设备管理代码(1)
开发语言·c#
❀搜不到13 小时前
isat-sam分割导出掩码图
开发语言·python
geovindu13 小时前
java: Memento Pattern
java·开发语言·后端·备忘录模式·行为模式
曾阿伦13 小时前
Trae CN Python环境调试debug指南
开发语言·python