VC 6.0: cannot open include file: 'streambuf': no such file or directory !!

Source: Internet
Author: User

Today, I am bored using the exercises C ++ in VC 6.0.Program.

Compilation error:
Cannot open include file: 'streambuf': no such file or directory !!

Checked

Convert the two statements

[# Include <iostream>

Using namespace STD;]

Change

[# Include <iostream. h>]

That's it!

This is a version issue. Some of the updates are different ......

Comments:

The format of <iostream> and <iostream. h> is different. The former has no suffix. In fact, you can see in your compiler include folder that the two are two files. When you open the file, you will find thatCodeIs different. Suffix. h header file C ++ standards have been explicitly proposed not to support, earlier implementation of the standard library function defined in the global space, declared in the. in the header file with the suffix H, the C ++ standard is used to distinguish it from C, and to correctly use the namespace, it is required that the header file does not use the suffix. h. Because of this, when <iostream. h> when <iostream> is used, it is equivalent to calling the library function in C and using a global namespace, that is, the early C ++ implementation, the header file does not have a global namespace defined. namespace must be used.
STD; in this way, cout can be used correctly.

 

I personally like Eclipse, which is beautiful and easy to operate. Just install the plug-in, CDT and mingw, and then configure the environment variables (* ^__ ^ ......

 

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.