Question about the file extension

Source: Internet
Author: User
For more information about file extension-general Linux technology-Linux technology and application, see the following. According to laruence's private dish, whether or not linux files can be fully viewed is related to the file name. The file extension that can be executed in windows is normal. com. exe. bat, etc. In linux, as long as the permission has x, this file can be executed.
The above is the original story of laruence. Now I have a question. I used vi to edit a file named test and a file named test. c file, the content of the two files is exactly the same, is a basic program:
# Include
Main ()
{
Printf ("hello, linux! \ N ");
}
It is different when compiling two files with gcc. When compiling test. c, everything works normally, but a problem occurs during the compilation of test. The compilation is not allowed, as shown below:
[Root @ localhost lili] # gcc test-o test. out
Test: file not recognized: File format not recognized
Collect2: ld returns 1
Isn't it true that files have nothing to do with extensions? The permissions for the two files are exactly the same!
[Root @ localhost lili] # ll test *
-Rw-r --. 1 root 55 Aug 17 23:29 test
-Rw-r --. 1 root 55 November 5 23:07 test. c
Why can't I compile without the extension? Where is the problem?

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.