【问题标题】:Error while creating qmake for a Qt static build为 Qt 静态构建创建 qmake 时出错
【发布时间】:2018-03-06 20:51:26
【问题描述】:

我在尝试使用此命令静态构建 Qt 库时遇到了困难:

/strg/Qt/qt-everywhere-src-5.10.0 $ ./configure -static -prefix /strg/Qt

并得到此响应:

+ cd qtbase
+ /strg/Qt/qt-everywhere-src-5.10.0/qtbase/configure -top-level -static -prefix /strg/Qt
./configure: 49: exec: /strg/Qt/qt-everywhere-src-5.10.0/qtbase/configure: not found

我尝试在文件qtbase/configure 上使用vim 命令set userformat=unix 解决此问题。

在运行同一行/strg/Qt/qt-everywhere-src-5.10.0 $ ./configure -static -prefix /strg/Qt 之后,情况也好不到哪里去:

Creating qmake...
’
make: *** [main.o] Error 1
.

我按照http://doc.qt.io/qt-5/linux-deployment.html 上的说明进行操作,我想我在前面的步骤中可能会出错。你能帮帮我吗?

【问题讨论】:

  • 你的/path/to/Qt是什么?
  • 这里是/strg/Qt/。源存储在/strg/Qt/qt-everywhere-src-5.10.0/
  • 那是什么/strg/Qt/qt-everywhere-src-5.10.0
  • 源文件存放在那里
  • 以下您分享的链接,您的-prefix 应该是/strg/Qt/qt-everywhere-src-5.10.0

标签: qt qmake static-linking


【解决方案1】:

好的,您的源代码位于 /strg/Qt/qt-everywhere-src-5.10.0。我更喜欢单独的构建和安装目录:

创建构建目录,例如/strg/Qt/build 并创建安装目录,例如/strg/Qt/安装

转到构建目录:

cd /strg/Qt/build

从您的构建目录运行配置并使用 -prefix 提供安装目录:

../qt-everywhere-src-5.10.0/configure -static -prefix /strg/Qt/install

您可能会使用的其他有用的配置参数(如果需要,请不要跳过 qtwebengine,如果不需要,跳过它可以节省大量时间)

../qt-everywhere-src-5.10.0/configure -opensource -confirm-license -static -release -prefix /strg/Qt/install -make libs -nomake tools -nomake examples -nomake tests -skip qtwebengine

【讨论】:

  • bash ../qt-everywhere-src-5.10.0/configure -static -prefix /strg/Qt/Install + cd qtbase + /strg/Qt/qt-everywhere-src-5.10.0/qtbase/configure -top-level -static -prefix /strg/Qt/Install Preparing build tree... Creating qmake... make: *** [main.o] Error 1 这是我从/strg/Build运行configure后得到的结果
  • 你的资源搞砸了吗?如果您提取干净的来源并重试怎么办?请记住在重试之前清空您的构建目录。你的 Linux 是什么,你的 gcc 版本是什么?
  • 实际上是同样的错误。我认为,问题可能出在文件格式上。我会尝试从qt档案download.qt.io/archive/qt/5.10/5.10.0下载不同的档案。
  • Mint 18.3 sylvia 和 gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多