gpt4 book ai didi

c++ - 带有 ax_check_compile_flag 的 autotools 语法错误

转载 作者:IT王子 更新时间:2023-10-29 00:10:39 34 4
gpt4 key购买 nike

我正在使用 autotools 构建我的 C++ 应用程序。在我的 configure.ac 中,我有以下行:

AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"])

在执行 ./configure 时(在运行 autoreconf -i 之后)会导致以下错误:

./configure: line 3825: syntax error near unexpected token `-Wall,'
./configure: line 3825: `AX_CHECK_COMPILE_FLAG(-Wall, CPPFLAGS="$CPPFLAGS -Wall")'

我的系统:Linux web 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux

在我的 Ubuntu 机器上运行良好,为什么会出现此错误?

最佳答案

autoreconf 并不神奇(尽管我遇到了显然相信这一点的包维护者)。当您运行 autoreconf 时,它找不到 AX_CHECK_COMPILE_FLAG 宏,并生成了损坏的 configure 脚本。通常这会同时产生错误/诊断消息。

'AX_CHECK_COMPILE_FLAG` 来自 autoconf archive项目,Debian 有一个提供此功能的软件包,名为 autoconf-archive .您可能忘记安装它:

sudo apt-get install autoconf-archive

关于c++ - 带有 ax_check_compile_flag 的 autotools 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30412576/

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