vican_lee 发表于 2006-4-30 12:06:34

新手求救.:编译内核过程中make config 的错误

编译内核linux-2.6.x过程中make config 的错误:

scripts/kconfig/conf.o:conf.c:<.text+0x91>:undefined reference to '_libintl_gettext'
scripts/kconfig/conf.o:conf.c:<.text+0xa5>:undefined reference to '_libintl_gettext'
scripts/kconfig/conf.o:conf.c:<.text+0xb9>:undefined reference to '_libintl_gettext'
等类似错误

我看到conf.c中有这句:#include "lkc.h"

然后我到"lkc.h"中发现#include <libintl.h>

然后再找libintl.h,找到好多个,不知道include了哪个


我估计可能是gettext这个函数没找到定义,
麻烦哪位高手指点一下迷津..谢谢先啦..

vican_lee 发表于 2006-4-30 17:55:27

前进了一步,新问题继续出现,继续请教.

我把linux-2.6.x\scripts\kconfig\lkc.h中的
#ifndef KBUILD_NO_NLS
# include <libintl.h>
前面加了一句
#define KBUILD_NO_NLS
就可以进入make了.(不知道有没有问题?)

但是在make的过程中提示:
Error:not ELF
不知道是什么错误,望高手指教一下.

gaiwang0142 发表于 2006-5-29 19:55:42

将linux\scripts\kconfig下makefile文件相应部分更改如下:
# Needed for systems without gettext
KBUILD_HAVE_NLS := $(shell \
   if echo "\#include <libintl.h>" | $(HOSTCC) $(HOSTCFLAGS) -E - > /dev/null 2>&1 ; \
   then echo yes ; \
   else echo no ; fi)
ifeq ($(KBUILD_HAVE_NLS),no)
HOSTCFLAGS        += -DKBUILD_NO_NLS
else
KBUILD_NEED_LINTL := $(shell \
if echo -e "\#include <libintl.h>\nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \
$(HOSTCC) $(HOSTCFLAGS) -x c - > /dev/null 2>&1 ; \
then echo no ; \
else echo yes ; fi)
ifeq ($(KBUILD_NEED_LINTL),yes)
HOSTLOADLIBES_conf += -lintl
HOSTLOADLIBES_mconf += -lintl
endif
endif
页: [1]
查看完整版本: 新手求救.:编译内核过程中make config 的错误