Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Problem building qt static on win 10

    General and Desktop
    2
    4
    801
    Loading More Posts
    • 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.
    • C
      ChortleMortal last edited by ChortleMortal

      I am trying to build a static version of qt on win 10 and get the following error:

      C:\Qt\5.12.2\Src\qtbase\src\corelib\global\qlibraryinfo.cpp: fatal error C1853: 'qmake_pch.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)

      This is surprising since I configured to not use precompiled headers. Here is how I am building the system if this gives any clues, or any of my configure options may be wrong

      "\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

      configure -static -release -no-pch -platform win32-msvc2017 -confirm-license -prefix "\QtStatic" -opensource -mp -nomake examples -nomake tests -no-icu -no-opengl -no-angle -no-openssl -skip webengine

      Any help would be welcome....

      1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        Did you use a clean source and build directory or did you compile with other options before in there?

        Qt has to stay free or it will die.

        C 2 Replies Last reply Reply Quote 2
        • C
          ChortleMortal @Christian Ehrlicher last edited by ChortleMortal

          @Christian-Ehrlicher
          It was clean at the beginning, although I have fiddled around with having or not having -no-pch since then. I will nuke the C:\Qt\5.12.2\Src directory and try again, but this will take a few hours.

          1 Reply Last reply Reply Quote 0
          • C
            ChortleMortal @Christian Ehrlicher last edited by

            @Christian-Ehrlicher
            OK. My mistake. I deleted the sources using the maintenance tool, deleted what was left in the Src directory, downloaded, and executed the two commands - and it built perfectly. So I must have done something wrong along the way. I see now the the qmake_pch.pch is build in the configure stage not the nmake stage, so it must have been me who built it with the wrong compiler.

            Apologies for wasting your time. I should have had the sense to rebuild from scratch without needing to be prompted.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post