linux中make命令报错,Linux命令make报错总结

Linux环境报错原因、解决方法记录(逐步总结)

1:/bin/sh: lex: command not found

make[1]: Leaving directory `/home/ksj/testCUnit/ltp-full-20081130/lib'

make[1]: Entering directory `/home/ksj/testCUnit/ltp-full-20081130/pan'

lex -l -w -t scan.l > scan.c

/bin/sh: lex: command not found

解决方法:下载flex    apt-get install flex

http://www.gnu.org/software/flex/

或者在http://flex.sourceforge.net/ 上下载

2:

编译一个linux下的c系统,包含词法和语法分析模块,Linux上用bison和flex。

yacc是一个文法分析器的生成器,bison即是yacc的GNU版本.Lex和YACC是用于构造词法分析机和语法解释器的工具,利用Lex和YACC你可以轻松的构造一个语法解释器。

一开始make

错误1:

debian:/home/a/boa-0.94.13/src# make

yacc -d boa_grammar.y

make: yacc: Command not found

make: *** [y.tab.c] Error 127

解决方法:

debian:/home/a/boa-0.94.13/src# apt-get install bison

错误2:

debian:/home/a/boa-0.94.13/src# make

lex boa_lexer.l

make: lex: Command not found

make: *** [lex.yy.c] Error 127

解决方法:

debian:/home/a/boa-0.94.13/src# apt-get install flex

错误3:

debian:/home/a/sss/boa-0.94.13/src# make

gcc -g -O2 -pipe -Wall -I. -c -o util.o util.c

util.c:100:1: error: pasting "t" and "->" does not give a valid preprocessing token

make: *** [util.o] Error 1

解决方法:

修改 src/compat.h

找到

#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff

修改成

#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff

然后

debian:/home/a/sss/boa-0.94.13/src# make clean

debian:/home/a/sss/boa-0.94.13/src# make

出现:

debian:/home/a/sss/boa-0.94.13/src# make

make: Nothing to be done for `all'.

说明make没有检查到需要编译的东西,库或者应用程序已经编译好了。

  make主要检查的是时间戳,只要target比依赖的文件时间靠后它就认为不需要编译。0b1331709591d260c1c78e86d0c51c18.png

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值