2016-04-26 20 views
3

私はVisual Studio 2015コミュニティで使用するためにQt 5.6.0をビルドしようとしていましたが、WebサイトとQt wikiのドキュメントはあまり具体的ではありませんVisual Studio用にビルドすることになります。私はそれを構築するために他のチュートリアルを試みたが、成功しなかった。
https://wiki.qt.io/Building_Qt_5_from_Git
https://doc.qt.io/qt-5/windows-building.htmlVisual Studio Community 2015用Qt 5.6.0をビルドする際のエラー

これらは、それを構築しようとしたとき、私が取る手順は次のとおりです:

  1. は、Dへのgitリポジトリからソースコードをクローン化された私は、次の試してみました

    チュートリアル:\ Programs \ qt5。

  2. 私がしたいブランチをチェックアウトしました。この場合、それは5.6.0であった。

  3. ビルド時間を短縮するために必須モジュールサブセットのみを複製しました。 \プログラム\のqt5:

    REM Set up \Microsoft Visual Studio 2015, where <arch> is \c amd64, \c x86, etc. 
    CALL "D:\Programs\Visual Studio 2015 Community\VC\vcvarsall.bat" amd64 
    SET _ROOT=D:\Programs\qt5 
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% 
    REM Uncomment the below line when using a git checkout of the source repository 
    SET PATH=%_ROOT%\qtrepotools\bin;%PATH% 
    SET QMAKESPEC=win32-msvc2015 
    SET _ROOT= 
    REM When compiling with ICU, uncomment the lines below and change <icupath> appropriately: 
    REM SET INCLUDE=<icupath>\include;%INCLUDE% 
    REM SET LIB=<icupath>\lib;%LIB% 
    REM SET PATH=<icupath>\lib;%PATH% 
    

    * SET QMAKESPEC行を削除しようとしましたし、それが影響しなかったCMDセッションのための環境変数を設定し、Dでそれを配置するバッチスクリプトを作成し

  4. 結果として生じるエラー

  5. VS2015の開発者コマンドプロンプトを開き、D:\ Programs \ qt5に移動します。

  6. ラン番号4でスクリプト

  7. はQt5ビルドを設定するコマンドを入力します。

    configure -developer-build -opensource -confirm-license -nomake tests -nomake examples -mp -skip qtwebengine -skip qtwebchannel 
    

    *必需品モジュールのサブセットを構築するだけにconfigureコマンドを使用する方法はありますか?

  8. Qtをビルドするコマンドを入力します。

    nmake 
    

    私はそれを構築しようとすると、私はこのエラーを取得する:

 

    D:\Programs\qt5>nmake 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      cd qtbase\ && (if not exist Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\qtbase.pro -o Makefile) && nmake -f Makefile 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      cd src\ && (if not exist Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\src.pro -o Makefile) && nmake -f Makefile 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      cd corelib\ && (if not exist Makefile.qtzlib D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\corelib\qtzlib.pro -o Makefile.qtzlib) && nmake -f Makefile.qtzlib 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      nmake -f Makefile.qtzlib.Debug all 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      copy /y ..\..\lib\Qt5Zlibd.dll ..\..\bin 
    The system cannot find the file specified. 
      nmake -f Makefile.qtzlib.Release all 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      copy /y ..\..\lib\Qt5Zlib.dll ..\..\bin 
    The system cannot find the file specified. 
      cd tools\bootstrap\ && (if not exist Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\tools\bootstrap\bootstrap.pro -o Makefile) && nmake -f Makefile 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      nmake -f Makefile.Debug 

    Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 
    Copyright (C) Microsoft Corporation. All rights reserved. 

      cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -D_HAS_EXCEPTIONS=0 -MP -GR -W3 -w34100 -w34189 -w44996 -WX /Fd..\..\..\lib\Qt5Bootstrapd.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_NO_CAST_FROM_ASCII -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -I. -I..\..\3rdparty\zlib -I..\..\..\include -I..\..\..\include\QtCore -I..\..\..\include\QtCore\5.6.1 -I..\..\..\include\QtCore\5.6.1\QtCore -I..\..\..\include\QtXml -I..\..\..\include\QtXml\5.6.1 -I..\..\..\include\QtXml\5.6.1\QtXml -Itmp -I..\..\..\mkspecs\win32-msvc2013 -Fo.obj\debug\ @C:\Users\Justin\AppData\Local\Temp\nm3B49.tmp 
    qlatincodec.cpp 
    qtextcodec.cpp 
    qutfcodec.cpp 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): error C2220: warning treated as error - no 'object' file generated (compiling source file ..\..\corelib\codecs\qlatincodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc (compiling source file ..\..\corelib\codecs\qlatincodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings (compiling source file ..\..\corelib\codecs\qlatincodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): error C2220: warning treated as error - no 'object' file generated (compiling source file ..\..\corelib\codecs\qutfcodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc (compiling source file ..\..\corelib\codecs\qutfcodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings (compiling source file ..\..\corelib\codecs\qutfcodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): error C2220: warning treated as error - no 'object' file generated (compiling source file ..\..\corelib\codecs\qtextcodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc (compiling source file ..\..\corelib\codecs\qtextcodec.cpp) 
    d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings (compiling source file ..\..\corelib\codecs\qtextcodec.cpp) 
    NMAKE : fatal error U1077: '"D:\Programs\Visual Studio 2015 Community\VC\BIN\amd64\cl.EXE"' : return code '0x2' 
    Stop. 
    NMAKE : fatal error U1077: '"D:\Programs\Visual Studio 2015 Community\VC\BIN\amd64\nmake.EXE"' : return code '0x2' 
    Stop. 
    NMAKE : fatal error U1077: 'cd' : return code '0x2' 
    Stop. 
    NMAKE : fatal error U1077: 'cd' : return code '0x2' 
    Stop. 
    NMAKE : fatal error U1077: 'cd' : return code '0x2' 
    Stop. 

私は修正を見つけるために、このエラーを探して試してみましたが、これまでのところ、私はすることができていませんそれに関する多くの情報を得ることができます。

この件に関するお手伝いをいただければ幸いです。

+0

'SET QMAKESPEC = win32-msvc2013'は間違っています。' SET QMAKESPEC = win32-msvc2015'を試してみてください。あるいは、明示的にmkspecを明示的に設定しないでください。 (それがうまくいくかどうか分かりませんが、試してみる価値はありません) –

+0

QMAKESPECをwin32-msvc2015に設定し、その行を完全に削除するよう提案しましたが、同じエラーが発生しました。迅速な応答ありがとう:)変更を反映するために元の質問を編集しました。 – JRud52

答えて

1

これは手動の修正ではなく、ソリューションそのものですが、エラーメッセージを見れば、あなたがこの参照してください。

CDツールを\ブートストラップ\ & &(Makefileを存在しない場合は...

nmake -f Makefile.Debug ....

そのフォルダに移動し、MakeFile.Debugファイルを開きます。 CXXFLAGSというエントリがあります。最後に "/ EHsc"を付けてファイルを保存します。

nmakeを再度実行してください。

エラーは多少混乱します。最初の

エラーC2220:エラーとして扱わ警告 - NO 'オブジェクトのファイルが

を発生しないQtが持っているという問題から、次のエラーです。

警告C4577: 'noexcept' いいえ例外処理モードで使用

指定された局所解にも言及されています

のVisual Studio 2015は、実際の問題が発生するいくつかの新しいredisignsを持っています

指定/ EHsc

これは私の修正内容です。これは単に、いくつかの例外を無視するか、それらを別々に処理するようにコンパイラに指示します。この場合、おそらく例外をスローするC関数から問題が発生しますが、C++ラッパーはそれを処理しません。

詳細は/EH documentationをご覧ください。

0

問題なくコンパイルされました(opensslとmysqlを含む)。いくつか指摘しました。

  • Perl-binはGitの前にある必要があります。
  • Python 2.7を使用してください(現在の3.xはAngleをクラッシュさせます)。
  • 利用-fとのperlのinit-リポジトリ(そうしないと、一貫性のないバージョンを持っているかもしれません)
  • 使用正しいのx86/x64のサードパーティのライブラリ。 (x64コマンドプロンプトでコンパイルするには、x64ライブラリを使用する必要があります)。
  • ブランチ5.7はバグがあるようです(qt3dのコンパイルの問題)。支店dev(8月29日から2016年)は私たちの友人のようです。
関連する問題