2016-04-26 5 views
3

Ich habe versucht, Qt 5.6.0 für die Verwendung mit Visual Studio 2015 Community zu bauen, aber die Dokumentation auf ihrer Website und auf dem Qt-Wiki ist nicht sehr spezifisch, wenn es kommt zum Aufbau für Visual Studio. Ich habe auch andere Tutorials versucht, um es zu bauen, aber ohne Erfolg.Fehler beim Erstellen von Qt 5.6.0 für Visual Studio Community 2015

Tutorials Ich habe versucht, folgende:
https://wiki.qt.io/Building_Qt_5_from_Git
https://doc.qt.io/qt-5/windows-building.html

Dies sind die Schritte, die ich nehmen, wenn es zu bauen versuchen:

  1. den Quellcode aus dem git Repo D Geklonte : \ Programme \ qt5.

  2. Haben den Zweig, den ich wollte. In diesem Fall war es 5.6.0.

  3. Nur die wesentliche Moduluntergruppe kloniert, um die Bauzeit zu reduzieren.

  4. eine Batch-Skript Erstellt die Umgebungsvariablen für die cmd-Sitzung zu setzen und legte es in D: \ Programme \ 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% 
    

    * Versucht, die SET QMAKESPEC Linie zu entfernen und es nicht beeinflussen die resultierenden Fehler.

  5. Öffnen Sie die Developer-Eingabeaufforderung für VS2015 und navigieren Sie zu D: \ Programme \ qt5.

  6. Führen Sie das Skript in Nummer 4.

  7. die Befehle Geben Sie die QT5 bauen zu konfigurieren.

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

    * Gibt es eine Möglichkeit, den Befehl configure nur die Wesentliche Modul Teilmenge bauen zu benutzen?

  8. Geben Sie den Befehl zum Erstellen von Qt ein.

    nmake 
    

    Ich bekomme diese Fehlermeldung, wenn ich versuche, es zu bauen:

 

    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. 

habe ich versucht, diesen Fehler zu suchen eine Lösung zu finden, aber bisher habe ich nicht in der Lage gewesen, bekomme viel Information darüber.

Jede Hilfe zu diesem Thema wäre sehr dankbar, danke.

+0

'SET QMAKESPEC = Win32-msvc2013' sieht falsch aus, versuchen Sie es mit' SET QMAKESPEC = win32-msvc2015'. Oder setzen Sie den mkspec nicht explizit. (nicht ganz sicher, ob das funktioniert, aber einen Versuch wert) –

+0

Ich habe versucht, die QMAKESPEC auf win32-msvc2015 zu setzen und diese Zeile komplett zu entfernen, aber es führte zu den gleichen Fehlern. Danke für die schnelle Antwort :) Bearbeitete die ursprüngliche Frage, um die Änderungen widerzuspiegeln. – JRud52

Antwort

1

Dies ist eine manuelle Korrektur, keine Lösung per se, aber wenn man sich die Fehlermeldung sehen Sie dies sehen:

cd tools \ Bootstrap \ & & (wenn nicht Makefile existiert ...

nmake -f Makefile.Debug ....

Gehen Sie zu diesem Ordner und öffnen Sie die Datei MakeFile.Debug. Dort finden Sie einen Eintrag namens CXXFLAGS. Füge "/ EHsc" an das Ende an und speichere die Datei.

Dann wieder einfach nmake ausführen.

Der Fehler ist leicht verwirrend. Die ersten

Fehler C2220: als Fehler behandelt Warnung - keine ‚Objekt‘ Datei

erzeugte

ist ein Schleppfehler von dem Problem, dass Qt wird mit. Visual Studio 2015 hat einige neue redisigns, die das eigentliche Problem verursacht:

Warnung C4577: 'noexcept' ohne die Ausnahmebehandlung Modus angegeben

Die lokale Lösung wird auch erwähnt:

Angeben/EHsc

Das ist also, was meine Lösung tut. Es weist den Compiler einfach an, einige Ausnahmen zu ignorieren oder sie anders zu behandeln. In diesem Fall tritt das Problem wahrscheinlich von einer C-Funktion auf, die eine Ausnahme auslöst, aber der C++ - Wrapper behandelt sie nicht.

Für weitere Informationen lesen Sie bitte /EH documentation.

0

Ich kompilierte ohne Probleme (einschließlich openssl und mysql). Ich habe einige Punkte herausgestrichen:

  • Perl-bin muss vor Git sein.
  • Verwenden Sie Python 2.7 (aktuelle 3.x wird Crash-Winkel).
  • Verwenden perl init-Repository mit -f
  • Verwenden 3rd-Party-Bibliotheken korrekt x86/x64 (sonst könnte man inkonsistente Versionen). (Kompilieren in x64-Eingabeaufforderung müssen Sie x64-Bibliotheken verwenden).
  • Zweig 5.7 scheint fehlerhaft zu sein (Probleme mit Qt3d kompilieren). Branch dev (vom 29. August 2016) scheint unser Freund zu sein.
Verwandte Themen