zoukankan      html  css  js  c++  java
  • autoreconf命令"possibly undefined macro: AC_ENABLE_SHARED"错误解决

    在一些环境中运行autoreconf或者autogen.sh时有时候会出现如下问题:

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

    出现这种类似问题一个原因是相关的库没有安装,或者是库的位置对不上,可通过如下方法逐步排查:

    1 先安装相关软件包

    sudo apt install automake libtool m4 autoconf

    2 检查安装目录

    grep "AC_ENABLE_SHARED" --color -rn /usr/

    通过上述命令查看AC_ENABLE_SHARED这些宏在哪个目录下文件定义,例如我的环境是在/usr/share/aclocal目录下:

    -bash-4.2$ grep "AC_ENABLE_SHARED" --color -rn /usr/share/*
    /usr/share/aclocal/ltoptions.m4:195:AC_DEFUN([AC_ENABLE_SHARED],
    /usr/share/aclocal/ltoptions.m4:203:AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])

    3 指定lib目录解决无法找到宏的问题

    autoreconf --include=/usr/share/aclocal/
  • 相关阅读:
    c++11 内存模型解读
    无锁队列的实现
    c++中的原子操作
    还是说Memory Model,gcc的__sync_synchronize真是太坑爹了
    对于Linux平台下C语言开发中__sync_函数的认识
    理解 Memory barrier
    pthread_barrier_init,pthread_barrier_wait简介
    explicit构造函数的作用
    droofs
    27.
  • 原文地址:https://www.cnblogs.com/liuhailong0112/p/15363601.html
Copyright © 2011-2022 走看看