【问题标题】:Cannot compile Qt from source using nmake install无法使用 nmake install 从源代码编译 Qt
【发布时间】:2016-06-20 17:56:03
【问题描述】:

我正在尝试根据this tutorial 从源代码编译 Qt5.7。我创建了qt5vars.cmd 文件:

cd "C:\Qt_all\qt-everywhere-opensource-src-5.7.0"
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
SET _ROOT="C:\Qt_all\qt-everywhere-opensource-src-5.7.0"
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
SET QMAKESPEC=win32-msvc2015
SET _ROOT=

我用cmd打开它:

C:\Qt_all\qt5vars.cmd

之后在cmd:

configure -debug-and-release -opensource -platform win32-msvc2015 -nomake examples -nomake tests
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake"

在这种情况下,一切正常,但 Qt 二进制文件被编译到“源代码”文件夹中。现在我想编译到另一个文件夹中。我完全删除了“源代码”文件夹(带有已编译的二进制文件)并复制了纯源代码文件夹。之后在cmd:

C:\Qt_all\qt5vars.cmd
configure -debug-and-release -opensource -platform win32-msvc2015 -nomake examples -nomake tests -prefix "C:\Qt_all\Kits\Qt5.7MSVC2015_64bit"
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake" install

这给出了一个错误:

LINK : fatal error LNK1104: cannot open file "C:\Qt_all\qt-everywhere-opensource-src-5.7.0\qtbase\lib\qtpcred.lib"

【问题讨论】:

    标签: qt compilation nmake


    【解决方案1】:

    您必须执行nmake,然后才执行nmake install。您可能还想使用jom -j%NUMBER_OF_PROCESSORS%,而不是nmake,来加快速度。 Jom 自带 Qt Creator,你也可以从here 获取。

    【讨论】:

      猜你喜欢
      • 2022-01-13
      • 1970-01-01
      • 1970-01-01
      • 2016-10-16
      • 1970-01-01
      • 2014-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多