PDA

View Full Version : zabbix-1.1alpha11 Compilation Error


bytesize
03-08-2005, 13:00
Hi guys,

I managed to compile and install zabbix-1.1alpha10 with no problems on my Fedora Core release 2 (Tettnang) server, but zabbix-1.1alpha11 fails with errors when I try and include the --enable-server option; if I leave this out it compiles fine.


Here is what I'm doing:


./configure --with-mysql --with-net-snmp --prefix=/usr/local/zabbix-1.1alpha11 --enable-server


<snip>
checking for NET-SNMP support... checking for main in -lcrypto... yes
yes
<snip>


There are no errors. I then type 'make' and get:

gcc -g -O2 -o zabbix_server -L/usr/local/mysql/lib/mysql -lmysqlclient -lm -lz evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a escalator/libzbxescalator.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a ../libs/zbxcommon/libzbxcommon.a -lnsl
server.o(.text+0x933): In function `main':
/usr/local/zabbix-1.1alpha11/src/zabbix_server/server.c:574: undefined reference to `init_snmp'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x53): In function `get_value_snmp':
/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:52: undefined reference to `snmp_sess_init'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x12e):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:122: undefined reference to `usmHMACMD5AuthProtocol'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x155):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:131: undefined reference to `usmHMACMD5AuthProtocol'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x15a):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:131: undefined reference to `generate_Ku'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x1a5):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:153: undefined reference to `snmp_open'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x1cd):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:164: undefined reference to `snmp_pdu_create'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x1eb):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:165: undefined reference to `read_objid'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x1fb):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:173: undefined reference to `snmp_add_null_var'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x21a):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:176: undefined reference to `snmp_synch_response'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x31f):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:291: undefined reference to `snmp_free_pdu'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x32b):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:293: undefined reference to `snmp_close'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x40d):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:258: undefined reference to `snmp_errstring'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x437):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:267: undefined reference to `snmp_errstring'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x469):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:262: undefined reference to `snmp_errstring'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x4c0):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:284: undefined reference to `snmp_sess_perror'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x4fb):/usr/local/zabbix-1.1alpha11/src/zabbix_server/poller/checks_snmp.c:276: undefined reference to `snmp_sess_perror'
collect2: ld returned 1 exit status
make[3]: *** [zabbix_server] Error 1
make[3]: Leaving directory `/usr/local/zabbix-1.1alpha11/src/zabbix_server'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/zabbix-1.1alpha11/src/zabbix_server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/zabbix-1.1alpha11/src'
make: *** [all-recursive] Error 1


It looks like it can't find net-snmp, but net-snmp-5.2.1.2 is definately installed (from source) and the libs are registered in ldconfig -v; besides, if it wasn't installed then the previous version of zabbix wouldn't have installed!!!

Any ideas?

Thanks in advance!

Regards,

John

bytesize
03-08-2005, 13:20
Surfing around I found this which seems to apply to my situation - not sure what file in Zabbix I need to correct though!


--- SNIP ---

It appears you forgot to link with the snmp library(-ies).

Assuming that the libraries are in the correct path (usually /usr/local/lib or
/usr/lib), adding -lsnmp (and possibly -lsnmpmibs and -lsnmphelpers) in the
linker command will allow you to create the executable.

If the libraries are in another path then place -L/path/to/netsnmp/libraries
before the -l* switches.

All this assumes that you use gcc or a linker that accepts -L and -l, if that
is not the case, see in your compiler/linker manual how to set the libraries
used for linking.

--- SNIP ---

dpsantos
03-08-2005, 13:53
SIMPLE....

Just add @SNMP_LFLAGS@ to line 170 of Makefile.in in the src/zabbix_server.

Duarte Santos :D

bytesize
03-08-2005, 14:13
Works a treat, thanks!!

...easy when you know how!!

Regards,

John

grabber
10-10-2005, 00:43
Works a treat, thanks!!

...easy when you know how!!

Regards,

John


Can you tell mehow? I am still getting this error and the @SNMP... is in the Makefile.in