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 headers

Precompiled headers

Scheduled Pinned Locked Moved C / C++ / MFC
c++questioncsharpcsswpf
1 Posts 1 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.
  • P Offline
    P Offline
    Patje
    wrote on last edited by
    #1

    I'm currently in the middle of redesigned a larger application. Previously the application was divided in [too] large chunks (I will use the term chunk to distinguish it from files/modules). Each chunk had a lot of source (mainly .c) files, but only one header (.h) file that had to be included by the routines of that chunk and by other routines that wanted to use that chunk. Up to now we used precompiled header files to speed up compilation (all files of a chunk had to include their own header file as first file). Now I want to divide all these chunks in smaller C++ classes. Each class will have its own header (.h) file and source (.cpp) file. My hope is to end up with less includes, less dependencies and thus a faster compilation. However, what I notice is just the opposite. We try to make a lot of use of STL and Boost templates, but these seem to slow down compilation seriously. On the other hand, we cannot use precompiled headers anymore because each class has its own header file. In the fantastic book 'Debugging Applications for .Net and Windows', the author, John Robbins, suggests to use one main header file (e.g. ALL.H) that is included (first) by all of our source files. All includes that aren't changed in the last 3 months should be put in that header file (including STL and Windows includes). In our case we would typically include STL and Boost header files in that ALL.H file, but the template constructions even seem to slow down compilations if precompiled header files are used. How do you organize your header files? How do you use precompiled headers? And what should be the correct way to use them? (maybe this could be a question for a poll, but it is probably too C++ oriented for that). Thanks for your help, fellow CPians. Enjoy life, this is not a rehearsal !!!

    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