I am trying to add new C file newfile_test.c in a kernel module. The C file has a #include <linux/types.h>
and no other include files present. Existing kernel module source code already has a header "helper.h" which includes the same <linux/types.h>
file.
Whenever I compile, I get below error for my newly added C file.
newfile_test.c(1) : error: wrong helper.h inclusion
Note: Line no.1 of the newfile_test.c is nothing but #include <linux/types.h>
line.
If I remove <linux/types.h>
include from the C file and add "helper.h" there, the compilation gets success. But I don't want to use helper.h in the file.
I don't know why the includes in my new C file are compared against some unrelated header file in the source code and being complained as compilation error in the C file.
Can anyone please help me understand the issue better?
TIA!
The compile error log looks like(changed the filename and paths per my need):
CC [M] /home/ramesh/ko/newfile_test.o
MF /home/ramesh/ko/newfile_test.c
/home/ramesh/ko/newfile_test.c(1) : error: wrong helper.h inclusion
make[1]: *** [/home/ramesh/ko/newfile_test.o] Error 1