Linux Run C + + program The difference between the GCC compiler and the g++ compiler

Source: Internet
Author: User

Both the GCC compiler and the g++ compiler go through these three steps at compile time: 1, preprocessing generates. i files

2, after preprocessing conversion to assembly generation. s file

3, assembly conversion to machine code generation executable. o File

4. Connect to generate executable file

However, in the GCC compiler, is not directly connected to the C + + library, so in the link process will be an error, as long as the link command after the addition of a "-lstdc++" can be implemented.

Both GCC and g++ can compile C and C + + code, and. c Files g++ as C + + files, and. cpp files, both of which are recognized as C + + files, and the compile phase g++ calls GCC. However, GCC cannot be linked to a C + + program's library, so it calls g++ to link

Linux Run C + + program The difference between the GCC compiler and the g++ compiler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.