我希望能够调试到 qt 源代码中,所以我开始在我的 MAC 上编译最新的 Qt 5.8 版。 我按照 Qt 网页上关于构建它的说明进行操作。但这是我在运行配置后得到的结果。
../qt-everywhere-opensource-src-5.8.0/configure -prefix /Users/userName/qt-install-5.8 0 -opensource -debug-and-release + cd qtbase + /Users/userName/qt-everywhere-opensource-src-5.8.0/qtbase/configure -top-level -prefix /Users/username/qt-install-5.8 0 -opensource -debug-and-release
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of the GNU Lesser General Public License (LGPL) version 3. You are also licensed to use this software under the terms of the GNU General Public License (GPL) version 2.
Type 'L' to view the GNU Lesser General Public License version 3. Type 'G' to view the GNU General Public License version 2. Type 'yes' to accept this license offer. Type 'no' to decline this license offer.
Do you accept the terms of either license? yes
Preparing build tree... Creating qmake... ............................................................................................Done.
ERROR: Invalid command line parameter '0'.
我不明白最后一行。我试图通过为构建创建一个新文件夹来进行影子构建。我在上面运行配置时还指定了安装目录。运行配置后,这些是在我的构建文件夹中创建的文件。
config.cache config.log qtbase
这看起来正确吗?
我是 MAC 平台的新手,但我已经完成了从 Windows 和 Linux 上的源代码编译 QT。
当我运行 make 时,这就是我得到的
make make: *** No targets specified and no makefile found. Stop
预先感谢您的帮助。
最佳答案
../qt-everywhere-opensource-src-5.8.0/configure -prefix /Users/userName/qt-install-5.8 0 -opensource -debug-and-release + cd qtbase + /Users/userName/qt-everywhere-opensource-src-5.8.0/qtbase/configure -top-level -prefix /Users/username/qt-install-5.8 0 -opensource -debug-and-release
看起来你在好几个地方都有错别字。你得到的不是“qt-install-5.8.0”,而是“qt-install-5.8 0”,它被 shell 解释为两个不同的参数(“qt-install-5.8”和“0”),并且配置脚本正确地提示“0”不是有效参数。
关于c++ - 在 macOS 上从源代码构建 Qt 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42318411/