2015-02-17 234 views
5

尝试构建libnice-0.1.10时遇到此类错误。对于解决方案,我正在关注possibly undefined macro: AC_MSG_ERROR,但还没有到达那里。AS_IF和AC_MSG_ERROR:错误:可能未定义宏

一些程序版本

uname: 3.5.0-23-generic 
m4: 1.4.16 
automake: 1.14.1 
autoconf: 2.69 
libtoolize: 2.4.2 

我还加ACLOCAL_FLAGS = “ - 我/.../share/aclocal” 中的.bashrc。

以下是autogen报告的症状。

$ ./autogen.sh 
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd 
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from... 
configure.ac:331: the top level 
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd 
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from... 
configure.ac:331: the top level 
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd 
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from... 
configure.ac:331: the top level 
libtoolize: putting auxiliary files in `.'. 
libtoolize: copying file `./ltmain.sh' 
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. 
libtoolize: copying file `m4/libtool.m4' 
libtoolize: copying file `m4/ltoptions.m4' 
libtoolize: copying file `m4/ltsugar.m4' 
libtoolize: copying file `m4/ltversion.m4' 
libtoolize: copying file `m4/lt~obsolete.m4' 
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd 
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from... 
configure.ac:331: the top level 
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd 
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from... 
configure.ac:331: the top level 
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd 
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from... 
configure.ac:331: the top level 
configure.ac:105: error: possibly undefined macro: AS_IF 
     If this token and others are legitimate, please use m4_pattern_allow. 
     See the Autoconf documentation. 
configure.ac:218: error: possibly undefined macro: AC_MSG_ERROR 
autoreconf: /opt/oblong/deps-64-10/bin/autoconf failed with exit status: 1 

非常感谢您的帮助!

+0

您是否安装了['pkg-config'](http://www.freedesktop.org/wiki/Software/pkg-config/)?看看是否存在'/.../share/aclocal/pkg.m4'。不需要设置ACLOCAL_INCLUDE - 该目录已经是autoconf的一部分,并且可能会阻止在libnice m4目录中搜索。 – 2015-02-18 08:26:09

回答

7

这只是意味着你错过了pkg-config(或者你也许有一个旧版本)。只需下载并安装。

+0

我确定安装了pkg-config,并且在我的系统上有/usr/share/aclocal/pkg.m4。 ACX_PTHREAD([AC_DEFINE([HAVE_PTHREAD] ...)。错误是configure.ac:31:错误:可能未定义宏:AC_DEFINE。如果此标记和其他标记合法,请使用m4_pattern_allow。因此可能还有其他原因。 – 2016-12-24 20:01:19

+0

您应该详细介绍导致“pkg-config”是问题的结论的故障排除步骤。 – jww 2018-01-04 11:05:33