I am trying to compile a driver under Debian 3.0r1 woody with GCC 2.95. The Makefile is set to compile with this command line:
gcc -DMODULE -D__KERNEL__ -DDBC=0 -Wall -Wstrict-prototypes-06 -I/usr/src/linux -c -o [filename].o [filename].c
Sorry, it's not verbatim, but my Linux partition cannot get Internet access until this module compiles and insmods correctly. /usr/src/linux is a symbolic link to the kernel headers for my kernel: /usr/src/kernel-headers-2.4.18-686/include/linux.
Any code that has #include <linux/modversions.h> gives me a file-not-found error message; however, other headers like #include <linux/config.h> do not give me such an error. I looked in the appropriate directory, and this file is there, along with the other headers.
Anyway, trying this sample code gives me the same errors with that header:
Code:
#include <linux/config.h>
#include <linux/modversions.h>
int main(void)
{
return 0;
}
Changing the include for modversions.h to #include "/usr/src/kernel-headers-2.4.18-686/include/linux/modversions.h" only creates file-not-found error messages for whatever modversions.h #include's. If I try compiling the driver with the #include for this header commented out, it will compile; but there will be unresolved external symbols when I try to use insmod on the module. I have also tried compiling this using gcc-3.0, but I get the same error. What should I do?