Background: So, I am not really experienced in using Linux, although I have done a little of bash scripting here and there and some other things. I am building a small RBAC LSM based on the framework, and have never before built a module in Linux.
Problem: I decided to build a small skeleton LSM, but when I try to compile it(only a single file as of now), gcc is unable to find a whole lot of header files in /usr/include/linux. I tried to locate those header files(found under /usr/src/kernels/<version>/include). I tried to include that location when compiling the program by using the -I option.
Code:
gcc -I<path> <filename>.c
I still get the same error(with using a space between -I and path and w/o too).
Here is the output from the above command. Not directly pasting it in here since I also used the -v option and the output is huge.
[Pastebin link].
Pastebin link
Here is the output of locate linux/init.h
Code:
/usr/src/kernels/2.6.32-431.23.3.el6.x86_64/include/linux/init.h
Uninstalled then installed gcc back again. Same result.
When I moved all files from the aforementioned location to the default location, other errors are coming.