配置Linux内核(menuconfig):重定义错误

时间:2014-02-18 15:08:44

标签: gcc linux-kernel

我有Linux Kernel 3.8.0源代码,在尝试使用 menuconfig 选项配置它时(使用“make menuconfig”终端命令),我得到以下错误列表:< / p>

DALEK linux-3.8.0 # make menuconfig
  HOSTCC  scripts/kconfig/mconf.o
In file included from scripts/kconfig/expr.h:15:0,
                 from scripts/kconfig/lkc.h:9,
                 from scripts/kconfig/mconf.c:22:
scripts/kconfig/list.h:23:8: error: redefinition of ‘struct list_head’
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/signal.h:9:0,
                 from scripts/kconfig/mconf.c:18:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/linux/list.h:19:8: note: originally defined here
In file included from scripts/kconfig/expr.h:15:0,
                 from scripts/kconfig/lkc.h:9,
                 from scripts/kconfig/mconf.c:22:
scripts/kconfig/list.h:57:19: error: conflicting types for ‘list_empty’
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/signal.h:9:0,
                 from scripts/kconfig/mconf.c:18:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/linux/list.h:193:19: note: previous definition of ‘list_empty’ was here
In file included from scripts/kconfig/expr.h:15:0,
                 from scripts/kconfig/lkc.h:9,
                 from scripts/kconfig/mconf.c:22:
scripts/kconfig/list.h:68:20: error: conflicting types for ‘__list_add’
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/signal.h:9:0,
                 from scripts/kconfig/mconf.c:18:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/linux/list.h:44:20: note: previous definition of ‘__list_add’ was here
In file included from scripts/kconfig/expr.h:15:0,
                 from scripts/kconfig/lkc.h:9,
                 from scripts/kconfig/mconf.c:22:
scripts/kconfig/list.h:86:20: error: conflicting types for ‘list_add_tail’
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/signal.h:9:0,
                 from scripts/kconfig/mconf.c:18:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/linux/list.h:81:20: note: previous definition of ‘list_add_tail’ was here
In file included from scripts/kconfig/mconf.c:23:0:
scripts/kconfig/lxdialog/dialog.h:62:0: warning: "MIN" redefined [enabled by default]
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/ctype.h:27:0,
                 from scripts/kconfig/mconf.c:11:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/features.h:153:0: note: this is the location of the previous definition
In file included from scripts/kconfig/mconf.c:23:0:
scripts/kconfig/lxdialog/dialog.h:63:0: warning: "MAX" redefined [enabled by default]
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/ctype.h:27:0,
                 from scripts/kconfig/mconf.c:11:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/features.h:148:0: note: this is the location of the previous definition
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2
DALEK linux-3.8.0 # 

显然,/ scripts / kconfig /中的源代码使用内核源代码的linux头文件定义了先前在头文件中定义的数据结构和常量。我该怎么做才能纠正这个问题,以便我可以运行menuconfig?

1 个答案:

答案 0 :(得分:0)

所以我修改了/ scripts / kconfig文件夹中的linux内核代码以清除重新定义并使用原始defs的头文件,现在Menuconfig工作正常。