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.
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
andlittle_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.What is the meaning of the default directories in the Linux filesystem hierachy?
See this link about gcc's searching preference
Another page explaining the /usr/include directory (The original link was removed, this is the one that's cached by archive.org)
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.
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. :)