Chinaunix首页 | 论坛 | 博客
  • 博客访问: 845323
  • 博文数量: 155
  • 博客积分: 4004
  • 博客等级: 中校
  • 技术积分: 2070
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-19 11:37
文章分类

全部博文(155)

文章存档

2014年(3)

2013年(9)

2012年(28)

2011年(20)

2010年(29)

2009年(66)

我的朋友

分类: C/C++

2013-06-25 15:27:59

GCC编译代码时,执行./configure在代码目录下生成了libtool脚本,再执行make 出现类似以下错误

点击(此处)折叠或打开

  1. ../libtool: line 832: X--tag=CC: command not found
  2. ../libtool: line 865: libtool: ignoring unknown tag : command not found
  3. ../libtool: line 832: X--mode=compile: command not found
  4. ../libtool: line 998: *** Warning: inferring the mode of operation is deprecated.: command not found
  5. ../libtool: line 999: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
  6. ../libtool: line 1142: Xgcc: command not found
  7. ../libtool: line 1142: X-DHAVE_CONFIG_H: command not found
  8. ../libtool: line 1142: X-I.: command not found
  9. ../libtool: line 1142: X-I../include: No such file or directory
  10. ../libtool: line 1142: X-g: command not found
  11. ../libtool: line 1142: X-I/usr/local/include: No such file or directory
  12. ../libtool: line 1142: X-g: command not found
  13. ../libtool: line 1142: X-O2: command not found
  14. ../libtool: line 1142: X-MT: command not found
  15. ../libtool: line 1142: Xargs.lo: command not found
  16. ../libtool: line 1142: X-MD: command not found
  17. ../libtool: line 1142: X-MP: command not found
  18. ../libtool: line 1142: X-MF: command not found
  19. ../libtool: line 1142: X.deps/args.Tpo: No such file or directory
  20. ../libtool: line 1142: X-c: command not found
  21. ../libtool: line 1193: Xargs.lo: command not found
  22. ../libtool: line 1198: libtool: compile: cannot determine name of library object from `': command not found

原因据说是因为在项目目录下生成的libtool脚本中定义了$ECHO变量,但是在脚本文件ltmain.sh中,使用的却是$echo(生成的libtool版本太旧)

打开aclocal.m4文件,可以在很前面的一段配置中找到这么两句



点击(此处)折叠或打开

  1. # This can be used to rebuild libtool when needed
  2. LIBTOOL_DEPS="$ltmain"

  3. # Always use our own libtool.
  4. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  5. AC_SUBST(LIBTOOL)dnl

可通过以下方法解决:

 

1. 直接复制系统自带的libtool到项目目录,应该在/usr/bin目录下,覆盖代码文件目录下的libtool,再执行make

(没装就apt-get install libtool 或者 yum install libtool 安装一下吧)

 

2.  修改aclocal.m4文件,将上面的LIBTOOL='$(SHELL) $(top_builddir)/libtool'改成LIBTOOL='$(SHELL)  /usr/bin/libtool'后重新执行./configure

 

3. 将源码目录下libtool脚本中所有的$ECHO替换成$echo. 或者将脚本文件ltmain.sh里的$echo替换成$ECHO,都一样,重新执行./configure

 


阅读(2795) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~