am__fastdepCXX does not appear in AM_CONDITIONAL

debian11,执行autogen.sh遇到的报错

/usr/share/automake-1.10/am/depend2.am: am__fastdepCXX does not appear in AM_CONDITIONAL
/usr/share/automake-1.10/am/depend2.am:   The usual way to define `am__fastdepCXX' is to add `AC_PROG_CXX'
/usr/share/automake-1.10/am/depend2.am:   to `configure.in' and run `aclocal' and `autoconf' again.
src/Makefile.am: C++ source seen but `CXX' is undefined
src/Makefile.am:   The usual way to define `CXX' is to add `AC_PROG_CXX'
src/Makefile.am:   to `configure.in' and run `autoconf' again.

找了半天找到的处理方案:

原文链接:am__fastdepCXX does not appear in AM_CONDITIONAL - 渊,知识厚薄也;冲,精神亢奋也; - 51Testing软件测试网 51Testing软件测试网-软件测试人的精神家园

总结下来就是两种方案,先执行第一种,如果解决了就不用执行方案2了,解决不了再用方案2试试,我是两个都用了才处理好。

方案一、安装libtool2.2以上的版本

sudo apt install libtool -y

方案二、configure.ac里面添加对应的配置(检查一下这四个选项,没有的话加上即可)

AC_INIT
AM_INIT_AUTOMAKE
AC_PROG_CXX
AC_PROG_LIBTOOL

具体问题原因,水平有限就不做误导了,有兴趣的同学可以看一下英文原版