[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dumb compilation question



this is my first post to this list, so hello!


i have kernel 2.4.2 installed, but the header files in /usr/include were put there
by debian woody.   so using a makefile of:


   blah: ${PROG}.c
         ${CC}  -c -Wall -O1  -DMODULE -D__KERNEL__ -DLINUX -D__SMP__ ${PROG}.


this naturally generates a link-time error since the header files in
/usr/include aren't the ones belonging to the currently running kernel:


   # insmod chardev.o
   chardev.o: kernel-module version mismatch
           chardev.o was compiled for kernel version 2.4.2-pre2
           while this kernel is version 2.4.2.



so instead, i tried using the include files supplied by the kernel source:


   CFLAGS = -c -O1 -nostdinc -I/usr/src/linux-2.4.2/include
   MODFLAGS := -DMODULE -D__KERNEL__ -DLINUX -D__SMP__
   
   chardev.o:  ${PROG}.c
         ${CC} ${CFLAGS} ${MODCFLAGS} ${PROG}.c


unfortunately, this doesn't work either.  it generates a compile-time error:


   # make
   gcc -c -O1 -nostdinc -I/usr/src/linux-2.4.2/include  chardev.c
   chardev.c:35: warning: `struct file' declared inside parameter list
   chardev.c:35: warning: its scope is only this definition or declaration,
      which is probably not what you want.


the "struct file" declaration is in fs.h.   gcc isn't complaining about not
finding /usr/src/linux-2.4.2/include/fs.h.  i'm looking at the declaration
right now.

what could possibly be going wrong?

thanks!
pete
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml