Skip to main content

Compilation Process of a C++ Program




Compiling a C++ program involves a number of steps (most of which are
transparent to the user):

· First, the C++ preprocessor goes over the program text and carries out theinstructions specified by the preprocessor directives (e.g., #include). The result is a modified program text which no longer contains any directives.

· Then, the C++ compiler translates the program code. The compiler may be a true C++ compiler which generates native (assembly or machine) code, or just a translator which translates the code into C. In the latter case, the resulting C code is then passed through a C compiler to produce native object code. In either case, the outcome may be incomplete due to the program referring to library routines which are not defined as a part of the program. For example, Listing 1.1 refers to the << operator which is actually defined in a separate IO library.


· Finally, the linker completes the object code by linking it with the object code of any library modules that the program may have referred to. The final result is an executable file.


In the following  Figure,  illustrates the above steps for both a C++ translator and a C++ native compiler. In practice all these steps are usually invoked by a single command (e.g. CC) and the user will not even see the intermediate files generated.


Comments

  1. ok thanks for this post it's quite informative and I have learned new things.
    kajal hot

    ReplyDelete
  2. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete
  3. Great Share!!!The parts of information about JAVA are much helpful for me...I would like to share this amazing Articles with my colleague circle...Keep posting like this more and more
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  4. I find this blog to be very interesting and very resourceful. I would say that your blogs are really interesting and informative for me and this article explained everything in detail.
    Java Training in Chennai

    Java Training in Velachery

    Java Training in Tambaram

    Java Training in Porur

    Java Training in Omr

    Java Training in Annanagar

    ReplyDelete
  5. Thanks for this Amazing blog , keep sharing this type of content with us and keep updating us. Apart from this if someone is looking for the best training institute in delhi for C++ traning or course in delhi , i would like to recommened High Technologies Solutions in delhi is the best training institute ,for more details call us on 9311002620
    visit website for more details
    Best Training Institute for c++ Training Course in Delhi, NCR


    ReplyDelete
  6. Thank you so much for this amazing blog. Keep sharing this type of content with us. If anyone wants to learn C/C++ in Delhi, I will recommend High Technologies Solutions training institute.
    For any further information please call +919311002620 or you can visit website https://htsindia.com/Courses/modular-courses/c-plus-plus-training-course

    ReplyDelete

Post a Comment

Give your valuable Comment...