zoukankan      html  css  js  c++  java
  • 报错"configure.ac: error: possibly undefined macro"的解决方案

    在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,就通过了。

  • 相关阅读:
    博客园
    未释放的已删除文件
    ssh连接缓慢
    剑指 Offer 38. 字符串的排列
    剑指 Offer 37. 序列化二叉树
    剑指 Offer 50. 第一个只出现一次的字符
    剑指 Offer 36. 二叉搜索树与双向链表
    剑指 Offer 35. 复杂链表的复制
    剑指 Offer 34. 二叉树中和为某一值的路径
    剑指 Offer 33. 二叉搜索树的后序遍历序列
  • 原文地址:https://www.cnblogs.com/y4247464/p/14388334.html
Copyright © 2011-2022 走看看