DBProxy
DBProxy copied to clipboard
安装报错
glib按照文档升级了,还是报错 CentOS release 6.5 (Final) Kernel \r on an \m
glib-ext.c: In function ‘g_string_get_time’:
glib-ext.c:122: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘m’
glib-ext.c:122: error: ‘m’ undeclared (first use in this function)
glib-ext.c:122: error: (Each undeclared identifier is reported only once
glib-ext.c:122: error: for each function it appears in.)
make[3]: *** [libmysql_chassis_glibext_la-glib-ext.lo] Error 1
make[3]: Leaving directory /data/src/DBProxy-master/src' make[2]: *** [all] Error 2 make[2]: Leaving directory
/data/src/DBProxy-master/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/src/DBProxy-master'
简直崩溃
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/local/glib-2.42/include/glib-2.0 -I/usr/local/glib-2.42/lib/glib-2.0/include -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -ggdb -g -O0 -MT libmysql_proxy_la-network-conn-pool-lua.lo -MD -MP -MF .deps/libmysql_proxy_la-network-conn-pool-lua.Tpo -c network-conn-pool-lua.c -fPIC -DPIC -o .libs/libmysql_proxy_la-network-conn-pool-lua.o
network-conn-pool-lua.c: In function ‘self_connect’:
network-conn-pool-lua.c:285: error: ‘CLIENT_PLUGIN_AUTH’ undeclared (first use in this function)
network-conn-pool-lua.c:285: error: (Each undeclared identifier is reported only once
network-conn-pool-lua.c:285: error: for each function it appears in.)
make[3]: *** [libmysql_proxy_la-network-conn-pool-lua.lo] Error 1
make[3]: Leaving directory /data/src/DBProxy-master/src' make[2]: *** [all] Error 2 make[2]: Leaving directory
/data/src/DBProxy-master/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/src/DBProxy-master'
make: *** [all] Error 2
跟你的报错相似。
[root@host252 DBProxy-0.2.4]# make && make install
make all-recursive
make[1]: Entering directory /app/DBProxy-0.2.4' Making all in src make[2]: Entering directory
/app/DBProxy-0.2.4/src'
make all-am
make[3]: Entering directory /app/DBProxy-0.2.4/src' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -ggdb -s -O0 -MT libmysql_chassis_glibext_la-glib-ext.lo -MD -MP -MF .deps/libmysql_chassis_glibext_la-glib-ext.Tpo -c -o libmysql_chassis_glibext_la-glib-ext.lo
test -f 'glib-ext.c' || echo './'glib-ext.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -ggdb -s -O0 -MT libmysql_chassis_glibext_la-glib-ext.lo -MD -MP -MF .deps/libmysql_chassis_glibext_la-glib-ext.Tpo -c glib-ext.c -fPIC -DPIC -o .libs/libmysql_chassis_glibext_la-glib-ext.o In file included from glib-ext.c:27: chassis-log.h:85: error: field ‘log_mutex’ has incomplete type In file included from glib-ext.c:27: chassis-log.h:117: error: field ‘log_q_t_lock’ has incomplete type glib-ext.c: In function ‘g_string_get_time’: glib-ext.c:122: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘m’ glib-ext.c:122: error: ‘m’ undeclared (first use in this function) glib-ext.c:122: error: (Each undeclared identifier is reported only once glib-ext.c:122: error: for each function it appears in.) make[3]: *** [libmysql_chassis_glibext_la-glib-ext.lo] Error 1 make[3]: Leaving directory
/app/DBProxy-0.2.4/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory /app/DBProxy-0.2.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/app/DBProxy-0.2.4'
make: *** [all] Error 2
[root@host252 DBProxy-0.2.4]#
glib-2.42 本地编译安装之后,会默认安装到/usr/local/路径下(如果没有指--prefix)。在编译DBProxy的时候,需要指定新安装的glib-2.42的libs和cflags路径。
尝试将./bootstrap.sh中内容修改为:
#!/bin/sh
base=$(cd "$(dirname "$0")"; pwd)
cd $base
./configure --prefix=/usr/local/mysql-proxy CFLAGS="-g -O0"
GLIB_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include"
GLIB_LIBS="-L/usr/local/lib -lglib-2.0"
GMODULE_CFLAGS="-pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include"
GMODULE_LIBS="-L/usr/local/lib -Wl,--export-dynamic -lgmodule-2.0 -pthread -lrt"
GTHREAD_CFLAGS="-pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include"
GTHREAD_LIBS="-L/usr/local/lib -lgthread-2.0 -pthread -lrt"