reducing build and link time

Posted on 2007-10-02
Last Modified: 2013-12-14
I have a general question

I have a big solution containing 22 projects...its MFC application with lots of dialog boxes, it handles audio calls n stuff...

please give me tips to reduce the build and link time....
Question by:kuchnaheen
    LVL 30

    Expert Comment

    22 projects is not that big.

    Are you doing full rebuilds?

    It shouldn't take that long to do an incremental build, unless  you're making header changes.
    LVL 30

    Expert Comment

    You can use the pimpl design pattern to avoid header changes.

    Another solution, if you have the money and extra build machines, is to use IncrediBuild.
    See following link:
    LVL 39

    Accepted Solution

    Are you using precompiled header files? If no, you might consider putting WINAPI and MFC headers into stdafx.h and create a stdafx.cpp which only includes stdafx.h. The stdafx.cpp needs to be included in your project and must be get the option (in C++ - Precompiled Header settings) that it should *create* the Precompiled Header File. Then set the project(s) to 'Using PCH thru stdafx.h" and add a '#include stdafx.h' at the top of each cpp file. Using PCH can increase your compile times significantly, especially when making a full rebuild. If you are using PCH already you may consider to add some of your big header files to stdafx.h. Especially if you are using 3rd-party libraries where the header files rarely are changing, you could add all these includes to stdafx.h. You should *not* add header files which are changing frequently, e. g. resource headers, cause that is contra-productive. Changing a header of the PCH leads to a full rebuild for all. Never add a template header to PCH cause a template header needs to compiled for each instance.

    Regards, Alex

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now