Gcc file compilation in Fedora 18

Source: Internet
Author: User

Today, I downloaded the source code with a cpp suffix and compiled and run it on the local machine. The problem may occur and then solved it in sequence. The following is an example:

I don't know how long I installed g ++ on Fedora 18. if you don't have it, run the command: yum install gcc-c ++.

After the compiler is solved, we may find errors during compilation. If you write the header file of iostream. h, the compilation will fail,

There is no iostream. h header file in/usr/include/c ++/4.7.2. Change it to iostream. Add using namespace before the main function

Std; one row; old files with. h suffixes, C ++ standard before birth (98 years. The C ++ standard header file does not have the. h suffix, and the standard library functions

All are placed in the std namespace. Don't follow the book to write. h. The teaching materials have been behind for more than 10 years!

Well, what I said later is what a Senior said. I was so excited that I learned something more than a decade ago, and I am ashamed to learn it.

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.