I am attempting to compile an old program that was released around 2007 on AlmaLinux 9. To this point I have been able to keep this thing running through all of the OS upgrades but this time it’s been a nightmare.
Whenever I try to compile this code I get these messages:
/bin/sh ../libtool –mode=link gcc -g -O2 -rpath ‘/usr/local/plot/lib’ -L/usr/lib64 -L >-L/usr/lib64 -L/usr/lib64 -L/usr/lib64 -o poll snmp.o dbi.o poll.o util.o targ.o gram.o >hash.o -lnetsnmp -lgd -lpng -lltdl -lz -lrt -lpthread -lm
(I’m not wholly certain why it has “-L/usr/lib64” 4x on that previous line.)
mkdir .libs
gcc -g -O2 -o poll snmp.o dbi.o poll.o util.o targ.o gram.o hash.o -L/usr/lib64 ->L/home/zct/build/src -lnetsnmp -lgd -lpng -lltdl -lz -lrt -lpthread -lm -Wl,–rpath ->Wl,/usr/local/plot/lib
/usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:28: multiple definition ofdb_test'; >snmp.o:/home/zct/build/src/dbi.h:28: first defined here /usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:29: multiple definition of
db_status’; >snmp.o:/home/zct/build/src/dbi.h:29: first defined here
/usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:36: multiple definition ofdb_connect'; >snmp.o:/home/zct/build/src/dbi.h:36: first defined here /usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:37: multiple definition of
db_disconnect’; >snmp.o:/home/zct/build/src/dbi.h:37: first defined here
/usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:38: multiple definition ofdb_commit'; >snmp.o:/home/zct/build/src/dbi.h:38: first defined here /usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:39: multiple definition of
db_insert’; >snmp.o:/home/zct/build/src/dbi.h:39: first defined here
/usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:30: multiple definition ofdb_populate'; >snmp.o:/home/zct/build/src/dbi.h:30: first defined here /usr/bin/ld: dbi.o:/home/zct/build/src/dbi.h:32: multiple definition of
db_intSpeed’; >snmp.o:/home/zct/build/src/dbi.h:32: first defined here
/usr/bin/ld: dbi.o:/home/zct/build/src/plot.h:154: multiple definition of `std_colors’; >snmp.o:/home/zct/build/src/plot.h:154: first defined here
collect2: error: ld returned 1 exit status
and this ultimate output:
make[1]: *** [Makefile:528: poll] Error 1
Here are lines 526-528 of Makefile:
poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES)
@rm -f poll$(EXEEXT)
$(AM_V_CCLD)$(poll_LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS)
make[1]: Leaving directory ‘/home/zct/build/src’
make: *** [Makefile:395: all] Error 2
Here are the lines
394-395:
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
I can’t tell if the ld messages are the reason the compilation is stopping or if those are just informational/warning messages.
Literally any nudge in the right direction is appreciated. I’ve fixed quite a few oddities to get to this point so far. Thank you.