Agent++: cannot find suitable libsnmp++ library

I got this same configure error :
configure: error: Cannot find suitable libsnmp++ library

from configure on agent+±4.6.1 using snmp+±3.5.2 on RHEL 8.10.

The error went away when I did this:
sudo -i
cd /usr/local/lib64
– remove previous libraries
rm -f libagent++.so libagent++.so.41 libagent++.so.41.0.1 libsnmp++.so libsnmp++.so.33 libsnmp++.so.33.0.11
cd ~/myloc/snmp+±3.5.2
make install
cd /usr/local/lib64
ln -s /usr/local/lib/libsnmp++.so.35.0.2 libsnmp++.so
ln -s /usr/local/lib/libsnmp++.so.35.0.2 libsnmp++.so.35
ln -s /usr/local/lib/libsnmp++.so.35.0.2 libsnmp++.so.35.0.2

I do not understand why this resolved the configure error.