【已解决】Cygwin 1.7.17下make编译crosstool-ng出错:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext’

   【问题】

   折腾:

   【记录】Cygwin下用crosstool-ng为arm制作交叉编译器

   期间,需要先把crosstool-ng安装到当前的Cygwin上:

   【记录】Cygwin下配置编译和安装crosstool-ng

   然后在make编译时出错:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  SED    'scripts/showTuple.sh'
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.gui.dep'
  DEP    'nconf.dep'
  DEP    'lxdialog/checklist.dep'
  DEP    'lxdialog/inputbox.dep'
  DEP    'lxdialog/util.dep'
  DEP    'lxdialog/textbox.dep'
  DEP    'lxdialog/yesno.dep'
  DEP    'lxdialog/menubox.dep'
  DEP    'mconf.dep'
  DEP    'conf.dep'
  BISON  'zconf.tab.c'
  GPERF  'zconf.hash.c'
  LEX    'lex.zconf.c'
  DEP    'zconf.tab.dep'
  CC     'zconf.tab.o'
  CC     'conf.o'
  LD     'conf'
zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x47fe): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x56ec): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x58be): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xc70b): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xc719): more undefined references to `_libintl_gettext' follow
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: zconf.tab.o: bad reloc address 0x110 in section `.data'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
Makefile:108: recipe for target `conf' failed
make[2]: *** [conf] Error 1
Makefile:160: recipe for target `build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:120: recipe for target `build' failed
make: *** [build] Error 2

   如图:

   zconf tab o zconf tab c text 0x162a undefined reference to _libintl_gettext

   即:

zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext'

   

【解决过程】

   1.此错误,之前就遇到的:

   【已解决】cygwin中编译crosstool-ng出错:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext’

   所以,打算去修改Makefile的。

   2.但是有了之前:

   【已解决】Cygwin下交叉编译Linux在make menuconfig时出错:scripts/kconfig/lxdialog/checklist.o:checklist.c: (.text+0×31): undefined reference to `wmove’

   的经验,打算去通过make时传入参数,试试能否解决问题。

   make LDFLAGS="-lintl"

   然后就解决问题了:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make LDFLAGS="-lintl"
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  LD     'conf'
  CC     'lxdialog/menubox.o'
  CC     'lxdialog/yesno.o'
  CC     'lxdialog/textbox.o'
  CC     'lxdialog/util.o'
  CC     'lxdialog/inputbox.o'
  CC     'lxdialog/checklist.o'
  CC     'mconf.o'

   

   如图:

   LD conf done ok

   

   【总结】

   此处,cygwin下,make编译crosstool-ng出现:

zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext'

的错误,

   原因是:

   缺少对应的intl的库

   解决办法是:

   在make时给LDFLAGS参数中,加上对应的intl库,即:

make LDFLAGS="-lintl"

   就可以了。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量