Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 659957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:06:11+00:00 2026-05-13T23:06:11+00:00

Why when I watch the build output from a VC++ project in VS do

  • 0

Why when I watch the build output from a VC++ project in VS do I see:

1>Compiling…
1>a.cpp
1>b.cpp
1>c.cpp
1>d.cpp
1>e.cpp
[etc…]
1>Generating code…
1>x.cpp
1>y.cpp
[etc…]

The output looks as though several compilation units are being handled before any code is generated. Is this really going on? I’m trying to improve build times, and by using pre-compiled headers, I’ve gotten great speedups for each “.cpp” file, but there is a relatively long pause during the “Generating Code…” message. I do not have “Whole Program Optimization” nor “Link Time Code Generation” turned on. If this is the case, then why? Why doesn’t VC++ compile each “.cpp” individually (which would include the code generation phase)? If this isn’t just an illusion of the output, is there cross-compilation-unit optimization potentially going on here? There don’t appear to be any compiler options to control that behavior (I know about WPO and LTCG, as mentioned above).

EDIT:
The build log just shows the “.obj” files in the output directory, one per line. There is no indication of “Compiling…” vs. “Generating code…” steps.

EDIT:
I have confirmed that this behavior has nothing to do with the “maximum number of parallel project builds” setting in Tools -> Options -> Projects and Solutions -> Build and Run. Nor is it related to the MSBuild project build output verbosity setting. Indeed if I cancel the build before the “Generating code…” step, none of the “.obj” files will exist for the most recent set of “compiled” files. This implies that the compiler truly is handling multiple translation units together. Why is this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:06:12+00:00Added an answer on May 13, 2026 at 11:06 pm

    Compiler architecture

    The compiler is not generating code from the source directly, it first compiles it into an intermediate form (see compiler front-end) and then generates the code from the intermediate form, including any optimizations (see compiler back-end).

    Visual Studio compiler process spawning

    In a Visual Studio build compiler process (cl.exe) is executed to compile multiple source files sharing the same command line options in one command. The compiler first performs "compilation" sequentially for each file (this is most likely front-end), but "Generating code" (probably back-end) is done together for all files once compilation is done with them.

    You can confirm this by watching cl.exe with Process Explorer.

    Why code generation for multiple files at once

    My guess is Code generation being done for multiple files at once is done to make the build process faster, as it includes some things which can be done only once for multiple sources, like instantiating templates – it has no use to instantiate them multiple times, as all instances but one would be discarded anyway.

    Whole program optimization

    In theory it would be possible to perform some cross-compilation-unit optimization as well at this point, but it is not done – no such optimizations are ever done unless enabled with /LTCG, and with LTCG the whole Code generation is done for the whole program at once (hence the Whole Program Optimization name).

    Note: it seems as if WPO is done by linker, as it produces exe from obj files, but this a kind of illusion – the obj files are not real object files, they contain the intermediate representation, and the "linker" is not a real linker, as it is not only linking the existing code, it is generating and optimizing the code as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a web site that users can build their TV watch list. They
I just add gcal to my project according to this tutorial http://www.youtube.com/watch?v=it_9H0GxRNI but 12
I'm trying to build an application using AIR 2's new NativeProcess API's going from
I am looking at the 'Metronome' sample code from the iOS SDK ( http://developer.apple.com/library/ios/#samplecode/Metronome/Introduction/Intro.html
I'm setting up a project that uses SASS, which uses FSEvents to keep from
When Build.pl of some Perl project is run on systems not used for Perl
I have the following code, which I am following from the jQuery documentation on
Ive been trying to build a 32X12X12 LED cube (something like this http://www.youtube.com/watch?v=f1YNyQqbiF0 )
I watch a lot of tutorials on the web, expesially ASP.NET tutorials - And
I'm trying to watch a process and wait for a certain pattern, say: open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.