PDA

View Full Version : MySQL compile error on alpha12


jeremy.lecour
19-09-2005, 19:35
Hello,

I've downloaded the latest (alpha12) on a RedHat 7.2 (2.4.31grs-piii-ipv4).

I've tried to compile, but I get errors with MySQL :

gcc -g -O2 -o zabbix_server -L/usr/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 -lresolv -lnsl
evalfunc.o: In function `evaluate_COUNT':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/evalfunc.c:93: undefined reference to `mysql_free_result'
evalfunc.o: In function `evaluate_SUM':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/evalfunc.c:142: undefined reference to `mysql_free_result'
evalfunc.o: In function `evaluate_AVG':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/evalfunc.c:192: undefined reference to `mysql_free_result'
evalfunc.o: In function `evaluate_MIN':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/evalfunc.c:242: undefined reference to `mysql_free_result'
evalfunc.o: In function `evaluate_MAX':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/evalfunc.c:292: undefined reference to `mysql_free_result'
evalfunc.o:/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/evalfunc.c:342: more undefined references to `mysql_free_result' follow
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBclose':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:47: undefined reference to `mysql_close'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBconnect':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:66: undefined reference to `mysql_init'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:67: undefined reference to `mysql_real_connect'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:69: undefined reference to `mysql_error'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:70: undefined reference to `mysql_error'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:71: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:71: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:78: undefined reference to `mysql_select_db'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:81: undefined reference to `mysql_error'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:82: undefined reference to `mysql_error'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBexecute':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:128: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:128: undefined reference to `mysql_error'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:129: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:129: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:134: undefined reference to `mysql_query'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBselect':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:174: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:174: undefined reference to `mysql_error'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:175: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:175: undefined reference to `mysql_errno'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:180: undefined reference to `mysql_query'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBget_field':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:214: undefined reference to `mysql_data_seek'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:215: undefined reference to `mysql_fetch_row'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:218: undefined reference to `mysql_error'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:219: undefined reference to `mysql_error'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBinsert_id':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:235: undefined reference to `mysql_insert_id'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBaffected_rows':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:249: undefined reference to `mysql_affected_rows'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBnum_rows':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:293: undefined reference to `mysql_num_rows'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBget_function_result':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:345: undefined reference to `mysql_free_result'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBget_prev_trigger_value':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:372: undefined reference to `mysql_free_result'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:381: undefined reference to `mysql_free_result'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:388: undefined reference to `mysql_free_result'
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:397: undefined reference to `mysql_free_result'
../libs/zbxdbhigh/libzbxdbhigh.a(db.o):/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:401: more undefined references to `mysql_free_result' follow
../libs/zbxdbhigh/libzbxdbhigh.a(db.o): In function `DBselect':
/usr/local/src/zabbix-1.1alpha12/src/libs/zbxdbhigh/db.c:182: undefined reference to `mysql_store_result'
pinger/libzbxpinger.a(pinger.o): In function `process_value':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/pinger/pinger.c:148: undefined reference to `mysql_free_result'
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/pinger/pinger.c:201: undefined reference to `mysql_free_result'
pinger/libzbxpinger.a(pinger.o): In function `create_host_file':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/pinger/pinger.c:256: undefined reference to `mysql_free_result'
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/pinger/pinger.c:270: undefined reference to `mysql_free_result'
poller/libzbxpoller.a(poller.o): In function `get_minnextcheck':
/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/poller/poller.c:132: undefined reference to `mysql_free_result'
poller/libzbxpoller.a(poller.o):/usr/local/src/zabbix-1.1alpha12/src/zabbix_server/poller/poller.c:169: more undefined references to `mysql_free_result' follow
collect2: ld returned 1 exit status
make[3]: *** [zabbix_server] Erreur 1
make[3]: Quitte le répertoire `/usr/local/src/zabbix-1.1alpha12/src/zabbix_server'
make[2]: *** [all-recursive] Erreur 1
make[2]: Quitte le répertoire `/usr/local/src/zabbix-1.1alpha12/src/zabbix_server'
make[1]: *** [all-recursive] Erreur 1
make[1]: Quitte le répertoire `/usr/local/src/zabbix-1.1alpha12/src'
make: *** [all-recursive] Erreur 1

If there is is some help around, I could use some :-)

Thank you before anything

mpsmyth
20-09-2005, 07:09
I am also getting failures in building alpha12 - hopefully I can shed some light on my issues. First I tried:

#./configure --enable-server --with-mysql --with-net-snmp --enable-static
and it failed miserably, throwing errors such as:
housekeeper/libzbxhousekeeper.a(housekeeper.o)(.text+0x20c): In function `delete_host':
/home/matthew/zabbix-1.1alpha12/src/zabbix_server/housekeeper/housekeeper.c:116
: undefined reference to `mysql_free_result'


Then I tried:
#./configure --enable-server --with-mysql --with-net-snmp
and when it did not error, I thought I had won. However, I looked in the bin directory and...

linuxtest:/home/matthew/zabbix-1.1alpha12# ls bin/
ZabbixW32.exe
linuxtest:/home/matthew/zabbix-1.1alpha12#

No joy.

I even tried #./configure --enable-agent --with-mysql --with-net-snmp and when I ran make it also left the bin directory empty.

I'm on Debian Sarge, and I checked and the mysql libraries are being found at /usr/lib, so it is not a missing library issue. If there were files being generated at all, that would make me feel better.

When I tried building alpha11, I got:
: undefined reference to `init_snmp'
so I removed the --with-net-snmp and it walked the whole tree successfully but I again got an empty bin directory.

Ideas?

Alexei
20-09-2005, 08:08
Use "make install". Also do not forget to add --prefix=<some dir> to ./configure.

jeremy.lecour
20-09-2005, 09:31
Thanks for answers.

I did this :
# ./configure --enable-server --enable-agent --with-mysql --prefix=/usr/local/zabbix

I don't want SNMP so I don't use "--with-net-snmp" and I want this host to monitor itself so I use both "--enable-server" and "--enable-agent"

Is there a difference in the order of arguments in the "./configure" call ?

But I still get the same errors on make or make install.

Thanks

jeremy.lecour
20-09-2005, 23:53
I still have the same errors with beta 1 :confused:

mpsmyth
21-09-2005, 06:42
Used:
./configure --enable-server --with-mysql --with-net-snmp --enable-static --prefix=/home/matthew/zabbix-1.1beta1

After that ran got:
Configuration:

Detected OS: linux-gnu
Install path: /home/matthew/zabbix-1.1beta1
Compiler: gcc
Compiler flags: -static -g -O2
Linker flags:


Then make died:
/home/matthew/zabbix-1.1beta1/src/zabbix_server/housekeeper/housekeeper.c:199: undefined reference to `mysql_free_result'
housekeeper/libzbxhousekeeper.a(housekeeper.o)(.text+0x6eb):/home/matthew/zabbix-1.1beta1/src/zabbix_server/housekeeper/housekeeper.c:275: more undefined references to `mysql_free_result' follow
collect2: ld returned 1 exit status
make[3]: *** [zabbix_server] Error 1
make[3]: Leaving directory `/home/matthew/zabbix-1.1beta1/src/zabbix_server'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/matthew/zabbix-1.1beta1/src/zabbix_server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/matthew/zabbix-1.1beta1/src'
make: *** [all-recursive] Error 1


Next, running without the static linkage:
linuxtest:/home/matthew/zabbix-1.1beta1# ./configure --enable-server --with-mysql --with-net-snmp --prefix=/home/matthew/zabbix-1.1beta1

Gives me no errors but no files:
make[1]: Leaving directory `/home/matthew/zabbix-1.1beta1'
linuxtest:/home/matthew/zabbix-1.1beta1# ls bin/
ZabbixW32.exe
linuxtest:/home/matthew/zabbix-1.1beta1#

Ran 'make install' and whoosh! in popped a file. Reviewing the make install output, it looks like --prefix is supposed to be where I want the app to end up. It would be useful to have that noted in the installation documentation...

However, the current answer is 'Hooray!' since I now have a file! Now to see about that agent...

And any clue what is up with the static link flag?