Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt 5.0.2 static compilation - VS2012 project fails
Forum Updated to NodeBB v4.3 + New Features

Qt 5.0.2 static compilation - VS2012 project fails

Scheduled Pinned Locked Moved Installation and Deployment
1 Posts 1 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeon22
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved