草庐IT

c++ - QT 5.7 MSVC 2015 静态构建不工作

coder 2024-06-20 原文

我在 Windows 上使用 32 位和 64 位 QT 5.7 MSVC 2015 静态版本时遇到问题。这些是我运行的命令和我得到的输出(也用 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

以下是我配置 QT 静态构建所遵循的步骤:

  1. 下载 QT 5.7 源码并解压到它自己的目录。
  2. 使用 QT Creator 和 msvc2015 32 位和 64 位安装了 QT。
  3. 安装了 Visual Studio 2015 Community 和所有 Visual C++ 选项 检查。
  4. 安装 Strawberry Perl 32 位并添加到路径中。
  5. 安装了 Python 2.7.12 并添加到路径中。
  6. 安装了 Ruby 并添加到路径中。
  7. 安装了 Windows 10 SDK 并检查了安装中的所有选项。
  8. 将 jom 安装到它自己的目录中。
  9. 已下载 openssl 源代码并根据 here 构建.
  10. 将 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. 在 32 位上运行:

     cd "\Program Files (x86)\Microsoft Visual Studio 14.0\vc"
     vcvarsall.bat x86
    
  12. 这适用于 64 位:

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

     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. 对于 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 -L C:\OpenSSL-win32\lib -l libeay32 -l ssleay32 -I C:\OpenSSL-win32\include -qt-libpng -qt-libjpeg -qt-zlib
    
  15. 对于 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 -L C:\OpenSSL-win64\lib -l libeay32 -l ssleay32 -I C:\OpenSSL-win64\include -qt-libpng -qt-libjpeg -qt-zlib
    
  16. 然后运行这些:

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

也确实验证了 win32-msvc2015 在静态构建目录的 mkspecs 目录中。我将 qt 静态目录重命名为第一个代码片段中的名称。我在谷歌上找不到太多,所以我在这里发帖希望能得到帮助。谢谢。我希望这很简单,就像我遗漏了一个目录以放入路径环境变量中...

最佳答案

原来问题是我在构建之后重命名了 QT 静态构建目录,这破坏了它。快速修复:将其重命名为原来的 configure -prefix 名称。谢谢库巴!

关于c++ - QT 5.7 MSVC 2015 静态构建不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40622198/

有关c++ - QT 5.7 MSVC 2015 静态构建不工作的更多相关文章

  1. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  2. ruby-on-rails - 'compass watch' 是如何工作的/它是如何与 rails 一起使用的 - 2

    我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t

  3. ruby-on-rails - 如何优雅地重启 thin + nginx? - 2

    我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server

  4. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

  5. ruby-on-rails - rspec should have_select ('cars' , :options => ['volvo' , 'saab' ] 不工作 - 2

    关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion在首页我有:汽车:VolvoSaabMercedesAudistatic_pages_spec.rb中的测试代码:it"shouldhavetherightselect"dovisithome_pathit{shouldhave_select('cars',:options=>['volvo','saab','mercedes','audi'])}end响应是rspec./spec/request

  6. ruby-on-rails - s3_direct_upload 在生产服务器中不工作 - 2

    在Rails4.0.2中,我使用s3_direct_upload和aws-sdkgems直接为s3存储桶上传文件。在开发环境中它工作正常,但在生产环境中它会抛出如下错误,ActionView::Template::Error(noimplicitconversionofnilintoString)在View中,create_cv_url,:id=>"s3_uploader",:key=>"cv_uploads/{unique_id}/${filename}",:key_starts_with=>"cv_uploads/",:callback_param=>"cv[direct_uplo

  7. ruby - JetBrains RubyMine 3.2.4 调试器不工作 - 2

    使用Ruby1.9.2运行IDE提示说需要gemruby​​-debug-base19x并提供安装它。但是,在尝试安装它时会显示消息Failedtoinstallgems.Followinggemswerenotinstalled:C:/ProgramFiles(x86)/JetBrains/RubyMine3.2.4/rb/gems/ruby-debug-base19x-0.11.30.pre2.gem:Errorinstallingruby-debug-base19x-0.11.30.pre2.gem:The'linecache19'nativegemrequiresinstall

  8. ruby - 在 Ruby 中构建长字符串的简洁方法 - 2

    在编写Ruby(客户端脚本)时,我看到了三种构建更长字符串的方法,包括行尾,所有这些对我来说“闻起来”有点难看。有没有更干净、更好的方法?变量递增。ifrender_quote?quote="NowthatthereistheTec-9,acrappyspraygunfromSouthMiami."quote+="ThisgunisadvertisedasthemostpopularguninAmericancrime.Doyoubelievethatshit?"quote+="Itactuallysaysthatinthelittlebookthatcomeswithit:themo

  9. ruby - 使用 `+=` 和 `send` 方法 - 2

    如何将send与+=一起使用?a=20;a.send"+=",10undefinedmethod`+='for20:Fixnuma=20;a+=10=>30 最佳答案 恐怕你不能。+=不是方法,而是语法糖。参见http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html它说Incommonwithmanyotherlanguages,Rubyhasasyntacticshortcut:a=a+2maybewrittenasa+=2.你能做的最好的事情是:

  10. ruby - `rescue $!` 是如何工作的? - 2

    我知道全局变量$!包含最新的异常对象,但我对下面的语法感到困惑。谁能帮助我理解以下语法?rescue$! 最佳答案 此构造可防止异常停止您的程序并使堆栈跟踪冒泡。它还会将该异常作为值返回,这很有用。a=get_me_datarescue$!在此行之后,a将保存请求的数据或异常。然后您可以分析该异常并采取相应措施。defget_me_dataraise'Nodataforyou'enda=get_me_datarescue$!puts"Executioncarrieson"pa#>>Executioncarrieson#>>#更现实的

随机推荐