Compiled for linux with USE_MYSQL – mysql still doesn't work

Here you can post threads specific to the current release of the core (099)
Post Reply
ghinzu
New User
Posts: 8
Joined: Fri May 10, 2013 12:32 pm

Compiled for linux with USE_MYSQL – mysql still doesn't work

Post by ghinzu »

Hello,

I successfully compiled pol099 from svn (I used svn rev572 + applied all the patches concerning linux). I used this as a reference to compile it. I run ubuntu 10 (+ I installed libmysqlclient-dev).

I uncommented USE_MYSQL=1 in build file. My buildcore32 looks like this:

Code: Select all

#!/bin/bash
#
# Build Official 32bit Release

export USE_MYSQL=1

export LIBCRYPT="crypto"
export POL_BUILDTAG="ubuntu"

export CXX_MORE_OPTS="-m32 -O3 -DUSE_SYSTEM_ZLIB -DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DPOL_BUILDTAG=\\\"ubuntu\\\""
#export CXX_MORE_OPTS="-m32 -O3 -DUSE_SYSTEM_ZLIB -DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DHAVE_MYSQL -DPOL_BUILDTAG==\\\"ubuntu\\\""

make -f makefile.gcc dist
And yet, when I try to access mysql functions, pol throws at me
error{ errortext = "POL was not compiled with MySQL support." }
What might be the problem here?
ghinzu
New User
Posts: 8
Joined: Fri May 10, 2013 12:32 pm

Re: Compiled for linux with USE_MYSQL – mysql still doesn't

Post by ghinzu »

Solved; just used the latest rev
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Compiled for linux with USE_MYSQL – mysql still doesn't

Post by RusseL »

I have some problems too. Need an advice :(

Code: Select all

/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(libmysql.c.o): In function `mysql_server_init':
(.text+0x63ca): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `add_plugin':
(.text+0x1ff): undefined reference to `dlclose'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `mysql_load_plugin_v':
(.text+0x2fc): undefined reference to `dlopen'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `mysql_load_plugin_v':
(.text+0x322): undefined reference to `dlsym'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `mysql_load_plugin_v':
(.text+0x474): undefined reference to `dlerror'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `mysql_load_plugin_v':
(.text+0x486): undefined reference to `dlclose'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `mysql_client_plugin_deinit':
(.text+0x747): undefined reference to `dlclose'
collect2: ld returned 1 exit status
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Compiled for linux with USE_MYSQL – mysql still doesn't

Post by RusseL »

Solved.
you need to link with dl library. add -ldl to the linker flags (makefile.gcc line 38 LIB_MORE += -lmysqlclient -lz -lpthread -ldl)

Another problem:
function mysql_close is not defined in sql.em

you need to add
mysql_close(connection);


ps: ubuntu users must install libmysqlclient18 and libmysqlclient-dev
Post Reply