Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41917

Precompiled header generation for Visual studio

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.5.0
    • 4.8.6, 5.3.0
    • Build tools: qmake
    • None
    • reproducible in QT 4.8.6 or QT 5.3.0 with both VisualStudio 2008 and 2013
    • dc612acdc6577594c8f61345cea2de549d7aae34

      If one want to put header and body of precompiled headers files in separate folder, Visual Studio compilation will fail. In fact, qmake do not generate visual studio project well.

      PrecompiledHeaderFile attribute of precompiled body item in visual studio project is filled with file name only. It should take full path.

      Both choice to resolve this issue :

      • put your .h and .cpp in the same folder
      • or modify qmake; replace this line in QMake qmake/generators/win32/msvc_objectmodel.cpp file :
       
      CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? Project->precompHFilename : QString("$(NOINHERIT)"));

      by

       
      CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? Project->precompH : QString("$(NOINHERIT)"));

      I have attached an example project.

        1. pch-issue.zip
          1 kB
          Quentin Brun
        For Gerrit Dashboard: QTBUG-41917
        # Subject Branch Project Status CR V

            jbornema Joerg Bornemann
            quentin.brun Quentin Brun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes