gpt4 book ai didi

c - `configure.ac` 文件给出错误

转载 作者:行者123 更新时间:2023-11-30 19:20:25 30 4
gpt4 key购买 nike

我正在创建一个用于学习自动工具的玩具示例。我创建了以下文件。configure.ac

AC_INIT([hello], [0.01])

# safety check -list a source file that wouldn't be in other directories :
AC_CONFIG_SRCDIR([hello.c])

# Put configuration results here so that we can easily #include them
AC_CONFIG_HEADERS([config.h])

# Put autotools aux files in a subdir . so they don't clutter top dir :
AC_CONFIG_AUX_DIR([build-aux])

# Enable "automake" to simplify creating makefiles :
AM_INIT_AUTOMAKE([1.11 -Wall -Werror]
AC_CONFIG_FILES([Makefile])

#look for a C compiler :
AC_PROG_CC

# Do final output
AC_OUTPUT

和一个Makefile.am:

bin_PROGRAMS = hello
hello_SOURCES = hello.c

hello.c:

#include <stdio.h>
int main()
{
printf("hello world!\n") ;
return 0 ;
}

然后我在终端中执行了 autoreconf -i 但我得到以下信息:

configure.ac:1: error: m4_init: unbalanced m4_divert_push:
configure.ac:17: m4_divert_push: GROW
configure.ac:1: m4_divert: BODY
../../lib/autoconf/c.m4:448: AC_PROG_CC is expanded from...
configure.ac:1: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

这些错误是什么,我该如何修复它们?

最佳答案

AM_INIT_AUTOMAKE([1.11 -Wall -Werror]

缺少)。不确定这是否是一个拼写错误

关于c - `configure.ac` 文件给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22246988/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com