简体   繁体   English

QT 5.7 MSVC 2015静态版本不起作用

[英]QT 5.7 MSVC 2015 Static Builds Not Working

I'm having trouble using my QT 5.7 MSVC 2015 static builds, both 32-bit and 64-bit, on Windows. 我在Windows上使用32位和64位QT 5.7 MSVC 2015静态版本时遇到问题。 These are the commands I run and the output I get (tested with 32 bit as well): 这些是我运行的命令和我得到的输出(也已通过32位测试):

C:\Users\Josh>set PATH=C:\Qt\static\Qt 5.7.0 MSVC2015_Static_x64\bin;%PATH%

C:\Users\Josh>cd "\Users\Josh\Mozy Sync\ReplicatorNew\ReplicatorNew"

C:\Users\Josh\Mozy Sync\ReplicatorNew\ReplicatorNew>qmake ReplicatorNew.pro
Could not find qmake configuration file win32-msvc2015.
Error processing project file: ReplicatorNew.pro

Here are the steps I followed to configure the QT static builds: 这是我配置QT静态版本所遵循的步骤:

  1. Downloaded QT 5.7 source and unzipped to its own directory. 下载了QT 5.7源文件并解压缩到其自己的目录中。
  2. Installed QT with QT Creator and msvc2015 32 and 64 bit. 使用QT Creator和msvc2015 32和64位安装了QT。
  3. Installed Visual Studio 2015 Community with all Visual C++ options checked. 安装了Visual Studio 2015社区并选中了所有Visual C ++选项。
  4. Installed Strawberry Perl 32 bit and added to path. 安装Strawberry Perl 32位并添加到路径。
  5. Installed Python 2.7.12 and added to path. 已安装Python 2.7.12并添加到path。
  6. Installed Ruby and added to path. 安装了Ruby并添加到path。
  7. Installed Windows 10 SDK and checked all options in install. 已安装Windows 10 SDK,并检查了安装中的所有选项。
  8. Installed jom to its own directory. 将jom安装到其自己的目录中。
  9. Downloaded openssl source and built as per here . 下载了openssl源代码,并按此处构建。
  10. Edited qtbase\\mkspecs\\common\\msvc-desktop.conf to the following: 将qtbase \\ mkspecs \\ common \\ msvc-desktop.conf编辑为以下内容:

      QMAKE_CFLAGS_RELEASE = -O2 -MT QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi QMAKE_CFLAGS_DEBUG = -Zi -MTd 
  11. Ran this for 32 bit: 将此运行32位:

      cd "\\Program Files (x86)\\Microsoft Visual Studio 14.0\\vc" vcvarsall.bat x86 
  12. This for 64 bit: 64位:

      cd "\\Program Files (x86)\\Microsoft Visual Studio 14.0\\vc" vcvarsall.bat amd64 
  13. Then these: 然后这些:

      set QMAKESPEC=win32-msvc2015 set QTDIR=C:\\Qt\\Static\\qt-everywhere-enterprise-src-5.7.0\\qtbase set PATH=C:\\Qt\\Static\\qt-everywhere-enterprise-src-5.7.0\\qtbase\\bin;%PATH% cd C:\\Qt\\Static\\qt-everywhere-enterprise-src-5.7.0 
  14. For 32 bit: 对于32位:

      configure -debug-and-release -confirm-license -platform win32-msvc2015 -opengl desktop -static -target xp -nomake examples -no-compile-examples -nomake tests -prefix C:\\Qt\\static\\MSVC2015_Static_x86 -openssl -LC:\\OpenSSL-win32\\lib -l libeay32 -l ssleay32 -IC:\\OpenSSL-win32\\include -qt-libpng -qt-libjpeg -qt-zlib 
  15. For 64 bit: 对于64位:

      configure -debug-and-release -confirm-license -platform win32-msvc2015 -opengl desktop -static -nomake examples -no-compile-examples -nomake tests -prefix C:\\Qt\\static\\MSVC2015_Static_x64 -openssl -LC:\\OpenSSL-win64\\lib -l libeay32 -l ssleay32 -IC:\\OpenSSL-win64\\include -qt-libpng -qt-libjpeg -qt-zlib 
  16. Then ran these: 然后运行这些:

      C:\\Qt\\static\\jom_1_1_1\\jom.exe -j 4 C:\\Qt\\static\\jom_1_1_1\\jom.exe -j 4 install 

Also definitely verified win32-msvc2015 was in the mkspecs directory of the static build directory. 还明确验证了win32-msvc2015在静态生成目录的mkspecs目录中。 I renamed the qt static dirs to the names in the first code snippet. 我将qt静态目录重命名为第一个代码段中的名称。 I couldn't find much on Google so I post here in hope of help. 我在Google上找不到很多东西,因此希望在这里发布帮助。 Thanks. 谢谢。 I'm hoping it's simple like I left out a directory to put in the path environment variable... 我希望这很简单,就像我遗漏了一个目录以放置路径环境变量一样...

Turns out the problem was I renamed the QT static build directory after the build, which broke it. 原来问题是我在构建后将QT静态构建目录重命名,这破坏了它。 Quick fix: rename it to its original configure -prefix name. 快速修复:将其重命名为其原始的configure -prefix名称。 Thanks Kuba! 谢谢库巴!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM