无法识别 libtool 和 autoconf 的 LT_VERSION

Posted

技术标签:

【中文标题】无法识别 libtool 和 autoconf 的 LT_VERSION【英文标题】:LT_VERSION for libtool and autoconf not being recognized 【发布时间】:2010-09-26 15:05:07 【问题描述】:

我的 configure.in 文件有 LT_VERSION="1.1"。我正在使用最新版本的 autoconf 和 libtool。在使用 autoconf 或 autoreconf 时,我收到以下错误消息:

configure.ac:41: error: possibly undefined macro: LT_VERSION
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

我能做什么?

【问题讨论】:

【参考方案1】:

我在 libtool 源代码树中找不到任何对 LT_VERSION 的引用(有一个 LTVERSION, 和一个 LTOBSOLETE_VERSION),所以我假设您的 configure.in 中的字符串(应该重命名为 configure.ac)是私有字符串,而不是 libtool 使用的字符串。在这种情况下,您应该做两件事。首先,您应该更改名称,因为您正在踩踏 libtool 的命名空间,并且似乎 LT_VERSION 被 libtool 使用(实际上,它看起来像 libtool 提供的 m4 宏,因此分配给它真的很奇怪)。其次,您应该使用 m4_pattern_allow。 (参见 autoconf 文档。)换句话说,把它放在你的 configure.ac 中:

m4_pattern_allow([LT_VERSION])

这将抑制警告。

【讨论】:

以上是关于无法识别 libtool 和 autoconf 的 LT_VERSION的主要内容,如果未能解决你的问题,请参考以下文章

安装 Autoconf, Automake & Libtool

如何正确更新 m4、autoconf、automake 和 libtool? Mac OSX

autoconf,automake,libtool

怎样查看autoconf,automake以及libtool是不是安装

手动安装m4, autoconf, automake, libtool

autoconf/automake/libtool - 如何取消定义 PACKAGE_NAME、PACKAGE_TARNAME、PACKAGE_VERSION 等