Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt 5.0.2 static compilation - VS2012 project fails



  • Hey community. First of all, please forgive my bad English (I'm a German pupil).
    I hope that I'm right here. I compiled Qt5 (5.0.2 from "HERE":http://download.qt-project.org/official_releases/qt/5.0/5.0.2/single/qt-everywhere-opensource-src-5.0.2.zip) statically with VS2012 x86 native tools and got no errors so far. I have installed the Qt5-Addin for Visual Studio 2012 and made a new Qt project. I linked manually against qwindows.lib (release) or qwindowsd.lib (debug). If I try to compile it with debug configuration I got this error:

    @error : Element <RuntimeLibrary> has an invalid value of "Multithreaded-Debug-DLL (/MTd)". C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets@

    Compilation with release configuration works, but if I try to start the program it closes itself and says: "Failed to load platform plugin "windows". Available platforms are: " (not as messagebox, but if I debug the release version with the VS2012 debugger I see it in the output box).
    What is the problem? I linked against these libs, so that the standalone-application should work, or what's my mistake here?
    I hope that someone can help me
    Jeon22

    P.S.: Before building Qt I extracted the source to E:\Qt\5.0.2, set the environment variables
    QTDIR=E:\Qt\5.0.2\qtbase
    QMAKESPEC=win32-msvc2012
    and added E:\Qt\5.0.2\qtbase\bin to PATH.
    Next I edited the following lines of E:\Qt\5.0.2\qtbase\mkspec\win32-msvc2012\qmake.conf:

    @QMAKE_CFLAGS_RELEASE = -O2 -MD
    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
    QMAKE_CFLAGS_DEBUG = -Zi -MDd@

    to

    @QMAKE_CFLAGS_RELEASE = -O2 -MT
    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
    QMAKE_CFLAGS_DEBUG = -Zi -MTd@

    Next I started "VS2012 x86 native tools command-prompt", navigated to E:\Qt\5.0.2 and configured using

    @configure -nomake docs -nomake examples -nomake tests -nomake demos -nomake webkit -debug-and-release -opensource -confirm-license -no-opengl -mp -static -platform win32-msvc2012 -qt-zlib -qt-libpng -qt-libjpeg@

    I compiled with "nmake" and waited some time.
    No errors during compilation. Everything seemed to be ok.


Log in to reply