Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Precompiled header stdafx.h

Precompiled header stdafx.h

Scheduled Pinned Locked Moved C / C++ / MFC
helpannouncementquestion
3 Posts 3 Posters 0 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.
  • G Offline
    G Offline
    garfield185
    wrote on last edited by
    #1

    Hi everybody. Good morning. I´d like to know what is the precompiled header for, why is ti useful, and what are the differences between Selecting "Not using precompiled headers" or using stdafx.h I´m getting an error message when building on Release version, something like this : Fatal error C1083: Cannot open precompiled header file: 'Release/TMB.pch': No such file or directory I can fix that by selecting Not using precompiled headers, but I want to know why it happens. Thanks!

    Time to come clean... Vive y deja vivir / Live and let live Javier

    M P 2 Replies Last reply
    0
    • G garfield185

      Hi everybody. Good morning. I´d like to know what is the precompiled header for, why is ti useful, and what are the differences between Selecting "Not using precompiled headers" or using stdafx.h I´m getting an error message when building on Release version, something like this : Fatal error C1083: Cannot open precompiled header file: 'Release/TMB.pch': No such file or directory I can fix that by selecting Not using precompiled headers, but I want to know why it happens. Thanks!

      Time to come clean... Vive y deja vivir / Live and let live Javier

      M Offline
      M Offline
      Matthew Faithfull
      wrote on last edited by
      #2

      PCHs do pretty much what they say on the tin. Ususally in the MSVC context your PCH is built from stdafx.h. This means the compiler takes stdafx.h and everything it #includes and compiles it first into a special 'pre-compiled' bunch of stuff it puts in the .pch file. Then when it sees #include "stdafx.h" in some other .cpp file later on it doesn't have to go through stdafx.h and all its included headers again it just links in the pre-compiled stuff from the .pch file it created before. Essentially it's a way of speeding up your builds. :) I don't know exactly why you're seeing this error but what it means is the .pch file has not been built for your Release build. If your settings are consistent. i.e. each .cpp is set correctly to use or not use a .pch and all the ones that use it generate it from the same header, then a full Rebuild should fix this. Sometimes the incremental linker gets confused and thinks the .pch has been built when it hasn't after something is changed that requires it to be rebuilt.

      Nothing is exactly what it seems but everything with seems can be unpicked.

      1 Reply Last reply
      0
      • G garfield185

        Hi everybody. Good morning. I´d like to know what is the precompiled header for, why is ti useful, and what are the differences between Selecting "Not using precompiled headers" or using stdafx.h I´m getting an error message when building on Release version, something like this : Fatal error C1083: Cannot open precompiled header file: 'Release/TMB.pch': No such file or directory I can fix that by selecting Not using precompiled headers, but I want to know why it happens. Thanks!

        Time to come clean... Vive y deja vivir / Live and let live Javier

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Please refer here[^]. Regards, Paresh.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups