Previously I’d been building SNMP++ applications in Visual Studio 2019, but I’m now trying to build under Ubuntu 22.04.
I’m getting errors when running configure.
NOTE: I’ve replaced some of the installed packages since I couldn’t find the ones mentioned in README.autoconf, but I don’t think that’s the issue.
- openssl-devel → libssl-dev
- libtomcrypt → libtomcrypt1
So I’ve been running the following commands on a fresh install of Ubuntu 22.04:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install autoconf libtool pkg-config libssl-dev libtomcrypt1
mkdir ~/Source
cd ~/Source
wget https://agentpp.com/download/snmp++-3.4.10.tar.gz
tar -xf snmp++-3.4.10.tar.gz
cd snmp++-3.4.10
autoreconf -i --force
./configure
This all seems to work fine until I get this error:
checking for unistd.h... yes
checking whether _AIX is declared... no
checking whether __linux is declared... yes
./configure: line 6660: syntax error near unexpected token `ac_fn_check_decl'
./configure: line 6660: `fi ac_fn_check_decl "$LINENO" "__sun" "ac_cv_have_decl___sun" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"'
I googled the issue, and the same error was logged in libstatgrab. Reading the following report suggested that they fixed it by editing the configure.ac file to move the comment:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993147#10
However, I tried making that change in the SNMP++ source with no effect.
Any ideas what’s up and how to fix this?