在ubuntu上编译内核时出错

时间:2012-05-31 06:02:21

标签: compiler-errors linux-kernel kernel

我在windows 7 pc上安装的vmware上使用ubuntu 12.04 ...我正在尝试编译linux-2.6.0源文件(从kernel.org下载)...我按照网络上的步骤进行操作但是有问题...

所以我搜索了一下并遇到this ...我按照答案中说的方式但仍然执行第二步后,当我继续执行第3步(make menuconfig)时,我得到了以下错误..

make[1]: `scripts/fixdep' is up to date.
HOSTCC  scripts/kconfig/mconf.o
scripts/kconfig/mconf.c:91:21: error: static declaration of ‘current_menu’ follows
non-static declaration
scripts/kconfig/lkc.h:63:21: note: previous declaration of ‘current_menu’ was here
scripts/kconfig/mconf.c: In function ‘show_textbox’:
scripts/kconfig/mconf.c:553:7: warning: ignoring return value of ‘write’, declared with
attribute warn_unused_result [-Wunused-result]
scripts/kconfig/mconf.c: In function ‘exec_conf’:
scripts/kconfig/mconf.c:225:6: warning: ignoring return value of ‘pipe’, declared with
attribute warn_unused_result [-Wunused-result]
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2

当我使用make xconfig时发生了同样的错误...请告诉我应该怎么做?提前谢谢。

2 个答案:

答案 0 :(得分:3)

Here is the answer 从scripts / kconfig / mconf.c中的'static struct menu * current_ment'行中删除'static'关键字

答案 1 :(得分:1)

'current_menu'在mconf.c:91中声明为静态,但在lkc.h:63中声明不是,当前版本的gcc可能不接受,gcc-2.95.3建议根据2.6.0源码中的README ,如果您真的想编译2.6.0,请尝试降级您的gcc版本。