最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Cygwin下make编译crosstool-ng出错:nconf.c:1521:2: error: lvalue required as left operand of assignment

crosstool-ng crifan 6363浏览 0评论

【问题】

折腾:

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

期间,在cygwin下,make编译crosstool-ng时出错:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make LDFLAGS="-lintl -lcurses"
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  LD     'mconf'
  CC     'nconf.o'
nconf.c: In function 'main':
nconf.c:1521:2: error: lvalue required as left operand of assignment
Makefile:95: recipe for target `nconf.o' failed
make[2]: *** [nconf.o] 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

如图:

nconf c error lvalue required as left operand of assignment

即:

nconf.c:1521:2: error: lvalue required as left operand of assignment

【解决过程】

1.以为这个问题,和之前遇到:

【已解决】用arm-xscale-linux-gnueabi编译代码出错:error: lvalue required as unary ‘&’ operand

的很类似,结果发现不是同一个问题。

2.所以先去看看代码:

crosstool-ng-1.18.0\kconfig\nconf.c

中的1521行,发现是之前就在:

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

中遇到的:

ESCDELAY = 1;

所以,去改为:

//ESCDELAY = 1;
set_escdelay(1);

再去编译,就至少消除了此处的错误:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make LDFLAGS="-lintl -lcurses"
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.dep'
  CC     'nconf.o'
  CC     'nconf.gui.o'

如图:

cc nconf o done ok

 

【总结】

在cygwin下make编译crosstool-ng出现:

nconf.c:1521:2: error: lvalue required as left operand of assignment

的错误,

原因是:

此处

crosstool-ng-1.18.0\kconfig\nconf.c

中,好像找不到对应的宏ESCDELAY,所以,代码:

ESCDELAY = 1;

才会报错。

解决办法是:

改为另外的写法:

//ESCDELAY = 1;
set_escdelay(1);

即可。

转载请注明:在路上 » 【已解决】Cygwin下make编译crosstool-ng出错:nconf.c:1521:2: error: lvalue required as left operand of assignment

与本文相关的文章

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.201 seconds, using 22.36MB memory