首页 > 系统服务 > 详细

报错"configure.ac: error: possibly undefined macro"的解决方案

时间:2021-02-08 16:39:49      阅读:212      评论:0      收藏:0      [点我收藏+]

在ubuntu上编译libzmq时,生成configure和makefile的过程中报错:

libzmq-master$ ./autogen.sh 
autoreconf: Entering directory `.autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I config --force -I config
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --include=config --force
configure.ac:28: error: possibly undefined macro: AC_SUBST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:74: error: missing some pkg-config macros (pkg-config package)
configure.ac:83: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
configure.ac:84: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:132: error: possibly undefined macro: AC_MSG_RESULT
configure.ac:145: error: possibly undefined macro: AC_DEFINE
configure.ac:253: error: possibly undefined macro: AC_CHECK_LIB
configure.ac:335: error: possibly undefined macro: AC_CHECK_HEADERS
configure.ac:337: error: possibly undefined macro: AC_MSG_ERROR
configure.ac:521: error: missing some pkg-config macros (pkg-config package)
configure.ac:526: error: possibly undefined macro: AC_SEARCH_LIBS
configure.ac:555: error: possibly undefined macro: AC_MSG_NOTICE
configure.ac:831: error: possibly undefined macro: AC_MSG_WARN
configure:6458: error: possibly undefined macro: AC_DISABLE_STATIC
configure:6462: error: possibly undefined macro: AC_ENABLE_STATIC
autoreconf: /usr/bin/autoconf failed with exit status: 1
autogen.sh: error: autoreconf exited with status 1

按照网友的建议,

sudo apt install automake libtool m4 autoconf

发现全都安装了。尝试其他解决方案:原文链接

一般通过apt-get安装的软件都会在/usr目录下,既然提示无法找到AC_PROG_LIBTOOL,那么分析一般有两个原因:

1.安装包失败或者其他原因比如版本问题导致没有定义AC_PROG_LIBTOOL;

2.寻找路径有问题。

从这两点出发,可以在/usr目录下全局查找AC_PROG_LIBTOOL

技术分享图片

 

 

可以看到在m4文件中能找到AC_PROG_LIBTOOL,那么就可能是路径问题;

大多数m4文件都在/usr/share/aclocal/目录下,但实际上configure的默认aclocal路径为/usr/local/share/aclocal,
那么可以有两种方法,
第一,将/usr/share/aclocal/下的*.m4文件都拷贝到usr/local/share/aclocal/目录下;
第二,指定aclocal的安装路径;

sudo cp /usr/share/aclocal/*.m4 /usr/local/share/aclocal/

再次./autogen.sh,就通过了。

 

报错"configure.ac: error: possibly undefined macro"的解决方案

原文:https://www.cnblogs.com/y4247464/p/14388334.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!