ubuntu 11.04 上的 autoconf 错误
我已经在谷歌上搜索并安装库一段时间了,但我无法用 autoconf 完全处理这个问题。
我已经下载了一个我想要编译的程序,做了一些更改,并且需要分别运行 autogen.sh 和 ./configure 并进行安装。
但是,当我尝试运行 autogen.sh 时,出现以下错误;
configure.ac:225: error: possibly undefined macro: AM_PATH_GTK_2_0
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
所以我继续下载 autoconf-2.68、automake-1.11、m4-1.4.16,并尝试 sudo apt-get install libgtk2.0-dev,但都没有改变结果。当我尝试 aclocal 时,我再次收到错误消息,
configure.ac:225: warning: macro `AM_PATH_GTK_2_0' not found in library
我目前被卡住了,无处可去。所以我很高兴收到任何建议。
i've been googling and installing libraries for a while, but I couldn't quite handle this problem with autoconf.
i have downloaded a program that i want to compile, made a few changes, and need to run autogen.sh and ./configure and make install respectively.
however, when i try to run autogen.sh, i get the following error;
configure.ac:225: error: possibly undefined macro: AM_PATH_GTK_2_0
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
so i went on, downloaded autoconf-2.68, automake-1.11, m4-1.4.16, and tried sudo apt-get install libgtk2.0-dev, none of which changed the outcome. when i try aclocal, i again get the error
configure.ac:225: warning: macro `AM_PATH_GTK_2_0' not found in library
i'm currently stuck, and got nowhere to go. so i'd be glad for any suggestion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道有点晚了,但您只需安装库
libgtk2.0-dev
:如果您收到与 GLIB 相关的错误,请安装
libglib2.0-dev
代码> 以及:I know it's a bit late, but you just have to install the library
libgtk2.0-dev
:If you get errors about something related to GLIB, then install
libglib2.0-dev
as well:给定名称 AM_PATH_GTK_2_0,可以进行以下一系列观察:
1)“AM_”位于automake的命名空间中,因此m4宏必须来自automake。
2)嗯,它不在automake中。
3)它可能来自gtk,所以gtk开发者在命名上犯了错误
他们的 m4 宏与 automake 冲突。这是 gtk 中的一个错误,但我可能需要
下载最新版本的gtk来获取宏。
问题是你没有 gtk 期望你拥有的 m4 宏。您可能需要安装 libgtk-devel (或类似的东西)。如果我是正确的并且 libgtk 确实正在安装名为 AM_... 的 m4 宏,请将其作为错误报告给开发人员。他们正在践踏 automakes 的命名空间(不幸的是,这是一个极其常见的错误。)
既然您提到下载 automake,我认为问题在于您运行的 aclocal 不是在 /usr/share/aclocal 中查找,而是在不同的位置(即,您在 /usr/local 中安装了 automake) 当您安装 libgtk-dev 时,它可能在 /usr/share/aclocal 中安装了 *.m4 文件,但您需要在 /usr/local/share/ 中该文件aclocal(或$prefix/share/aclocal,其中 prefix 是您用于安装 automake 的内容。)最简单的解决方案是将该文件复制到 $(aclocal --print) 即运行“aclocal --print”以查看 aclocal 正在查找的位置对于 m4 文件,然后找到 libgtk-dev 安装的文件,该文件定义了不正确命名的 m4 宏,并将该文件复制到适当的位置。或者(可能是更好的解决方案),您可以在 $(aclocal --print) 中放置一个名为 dirlist 的文件,其中包含单行“/usr/share/aclocal”,以便您手动安装的 aclocal 将始终查找以下 m4 文件安装在 /usr/share 中。
Given the name AM_PATH_GTK_2_0, one makes the following sequence of observations:
1) "AM_" is in automake's namespace, so that m4 macro must come from automake.
2) Hmmm, it isn't in automake.
3) It probably comes from gtk, so the gtk developer's have made an error in naming
their m4 macro in conflict with automake. That's a bug in gtk, but I'll probably need
to download the newest version of gtk to get the macro.
The problem is that you don't have the m4 macro that gtk expects you to have. You probably need to install libgtk-devel (or something like that). If I am correct and libgtk is indeed installing an m4 macro named AM_..., please report that as a bug to the developers. They are stomping on automakes' namespace (this is, unfortunately, an extremely common error.)
Since you mention downloading automake, I think the problem is that you are running aclocal that is not looking in /usr/share/aclocal, but in a different location (ie, you installed automake in /usr/local) When you installed libgtk-dev, it probably installed the *.m4 file in /usr/share/aclocal, but you need that file in /usr/local/share/aclocal (or $prefix/share/aclocal, where prefix is what you used to install automake.) The simplest solution is to copy that file to $(aclocal --print) That is, run "aclocal --print" to see where aclocal is looking for m4 files, then find the file that libgtk-dev installed that defines the improperly named m4 macro and copy that file to the appropriate location. Alternatively (and probably a better solution) you can put a file named dirlist in $(aclocal --print) that contains the single line "/usr/share/aclocal", so that your hand installed aclocal will always look for m4 files that are installed in /usr/share.
如果在 CenOS/RedHat 上出现同样的问题:
In case of same issue on CenOS/RedHat: