Chinaunix

标题: LDD3 SCULL Compiler Error [打印本页]

作者: Junping1982    时间: 2009-09-25 10:59
标题: LDD3 SCULL Compiler Error
Question 1:
make -C /lib/modules/2.6.27.10-1/build M=/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull LDDINC=/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/../include modules
make[1]: Entering directory `/usr/src/kernels/2.6.27.10-1-i686'
scripts/Makefile.build:46: *** CFLAGS was changed in "/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/Makefile". Fix it to use EXTRA_CFLAGS.  Stop.
make[1]: *** [_module_/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.27.10-1-i686'
make: *** [modules] Error 2
Answer:
Change  file L12~L13
  1 # Comment/uncomment the following line to disable/enable debugging
  2 #DEBUG = y
  3
  4
  5 # Add your debugging flag (or not) to CFLAGS
  6 ifeq ($(DEBUG),y)
  7   DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines
  8 else
  9   DEBFLAGS = -O2
10 endif
11
12 CFLAGS += -I$(LDDINC)
13 CFLAGS += $(DEBFLAGS)
14
15 ifneq ($(KERNELRELEASE),)
16 # call from kernel build system
To
  1 # Comment/uncomment the following line to disable/enable debugging
  2 #DEBUG = y
  3
  4
  5 # Add your debugging flag (or not) to CFLAGS
  6 ifeq ($(DEBUG),y)
  7   DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines
  8 else
  9   DEBFLAGS = -O2
10 endif
11
12 #CFLAGS += -I$(LDDINC)
13 #CFLAGS += $(DEBFLAGS)
14
15 ifneq ($(KERNELRELEASE),)
16 # call from kernel build system
Question 2:
make -C /lib/modules/2.6.27.10-1/build M=/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull LDDINC=/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/../include modules
make[1]: Entering directory `/usr/src/kernels/2.6.27.10-1-i686'
  CC [M]  /mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.o
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c: In function 'scull_u_open':
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:107: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:108: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:115: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c: In function 'scull_w_available':
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:166: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:167: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c: In function 'scull_w_open':
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:180: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:180: error: (Each undeclared identifier is reported only once
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:180: error: for each function it appears in.)
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:180: error: implicit declaration of function 'signal_pending'
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:180: error: implicit declaration of function 'schedule'
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:185: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c: In function 'scull_w_release':
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:206: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c: In function 'scull_c_open':
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:278: error: dereferencing pointer to incomplete type
/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.c:282: error: dereferencing pointer to incomplete type
make[2]: *** [/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull/access.o] Error 1
make[1]: *** [_module_/mnt/sda7/Linux/Devices_Drivers/LDD3/ldd3_code/scull] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.27.10-1-i686'
make: *** [modules] Error 2
Answer:
Insert head file
#include
#include  /* printk() */
#include
#include    /* kmalloc() */
#include      /* everything... */
#include   /* error codes */
#include   /* size_t */
#include
#include
#include
#include
#include
Question:
if print the message is ""
Answer:
sudo touch /usr/include/linux/config.h
and modifi the main.c
#include
to
#include "/usr/include/linux/config.h"
if you del the line, I think you're right.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/96896/showart_2059709.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2