From a simple compilation Error

Source: Internet
Author: User
From a simple compilation error-general Linux technology-Linux programming and kernel information, the following is a detailed description. Author: Lu Tao

A few days ago, I tried gcc in Ubuntu and compiled a very simple program, which is the first example of almost all programming books: HelloWorld program. It is as simple as three or four lines of code, but it always prompts Cannot open include file: 'stdio '. I thought the compiler could not find the library file stdio. h! Go to various forums and search for answers under Baidu! There are many similar problems. The main solution is to install the required library files, but search for the new software package of Ubuntu, whether it is build-essential, lib-dev6 I already have it in my system! At this time, I had to unmount the gcc and related libraries and reinstall them again! I can't translate it again! You can find stdio. h under/usr/include!

I did not think that this small problem had bothered me for two days, so I had to find a solution! At that time, I was desperate and even thought it was a problem with Ubuntu. I never encountered this problem under redhat! Later, when reading a blog post or post, the author mentioned that an absolute path can be added to the contained file, that is, the file inclusion statement can be changed to # include. With a try attitude, it is also the last line of hope, re-open the source code, this problem finally came out, the original # include Written by mistake # include . In fact, the prompted compilation error is always 'stdio 'rather than 'stdio. H '!

After thinking about the problem, I never thought that my code was wrong (this program is too simple) and I always thought it was a problem with the compiler, is a problem with library files and even Ubuntu systems! In fact, people think this way not only in such a small program. When we encounter things, we often think that it is not our own problem. It must be something wrong with others, that's the result! It seems that in the future, we should start from ourselves and think about whether we have done anything wrong, and then investigate others' responsibilities! Because the problem often comes from the small links we ignore!
Related Article

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.