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

相关推荐
不会c+2 分钟前
C语言:入门到精通(408考研版)系列七 派生的数据类型
c语言·开发语言
不定积分要+C_yyy37 分钟前
Java基础核心精讲:基本数据类型与包装类区别、自动装箱拆箱与缓存陷阱实战解析
java·开发语言
xingxiliang39 分钟前
ReliableAgent:类似工程级可用的agent示例
java·开发语言·agent
buhuizhiyuci1 小时前
【python篇——一周速通python语法】python的基础语法操作
开发语言·python
程序猿编码1 小时前
没有AI框架,没有GPU,一个C语言文件跑通大模型
c语言·开发语言·人工智能·深度学习·ai·大模型
zmzb01031 小时前
C++课后习题训练记录Day160
开发语言·c++
沫璃染墨1 小时前
现代C++⊂C++11篇(一)列表初始化全解 & std::initializer_list
开发语言·c++
阿米亚波1 小时前
【C++ STL】std::forward_list
开发语言·c++·笔记·stl·visual studio·forward_list
buhuizhiyuci2 小时前
【python篇——一周速通python语法】python的条件语句和循环语句
开发语言·python
geovindu2 小时前
go: Recursion Algorithm
开发语言·后端·算法·golang·递归算法