19

I'm very new to Ubuntu. I'm looking at the directory /usr/include it contains lot of header files. I know they have specified certain constants and other information that are used in Ubuntu. I'm confused with the use of it.

One of the directory inside is linux/byteorder. Which has two files:

big_endian.h  little_endian.h

I wonder why two files are needed? My machine will be either big endian or little endian right? Didn't ubuntu while installation didn't pick my system byte order? Does /usr/include is just same for all machines? What is the exact use of it?

Thanks in advance.

batman
  • 7,961

3 Answers3

21

That folder includes the header files for C compilers. Such as "stdio.h", "stdlib.h" etc.

When you type header information in the C source file such #include <stdio.h> the compiler will look for the file in /usr/include directory by default.

big_endian.h and little_endina.h files are included, because though your computer may be of only one kind, you can cross-develop application for both architecture. So, you need both header file.

Anwar
  • 76,649
  • Your third link needs to be translated and then it is reported as broken. – WinEunuuchs2Unix May 26 '17 at 01:41
  • @WinEunuuchs2Unix of course it wasn't like that before. Must have changed. I'll remove it. The older page can be accessed via cache here http://web.archive.org/web/20100511072431/http://bid.ankara.edu.tr/yardim/linux.install.guide/node116.html – Anwar May 26 '17 at 05:56
4

These files are needed when you compile programs, be that a software package you need to compile manually or your own programs. They are included in the C code such that you can use the functions defined there. Don't worry about them if you don't code.

January
  • 35,952
1

Yes but you may decide to develop a cross platform app.

And when you write program for the other machine which is different endian than yours. Then may be these files are used to compile such programs. :)

Sam
  • 1,009