Jump to content

Problem making realmd, mysql seems undefined in DatabaseMysql.cpp


Recommended Posts

/push Problem solved see bottom of first post.

I just found out I have exactly the same unresolved problem as described in those two threads:

http://getmangos.eu/community/showthread.php?7010-compile-on-Mandriva-2009.0.0-0.11-cooker-HELP

http://getmangos.eu/community/showthread.php?10931-Include-MySQL-Libraries&highlight=%2Fusr%2Finclude%2Fmysql

Also testet this:

export CPPFLAGS="-I/usr/include/mysql -I/usr/include/mysql++"

Problem persists.

May this problem be related to the libmysqlclient libs I'm using?

Please help me...

Link to comment
Share on other sites

  • 40 years later...

Hello,

i'm in a 64bit Arch environment I get the following error on making realmd. All dependent packages should be installed.

I've got mysql-5.1.46 and libmysqlclient-5.1.46.

Error:

Making all in realmd
make[3]: Entering directory `/home/*****/mangos/src/mangos-build/objdir/src/realmd'
 CXX    AuthSocket.o
 CXX    Main.o
 CXX    RealmList.o
 CXXLD  mangos-realmd
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::~DatabaseMysql()':
DatabaseMysql.cpp:(.text+0x228): undefined reference to `mysql_close'
DatabaseMysql.cpp:(.text+0x244): undefined reference to `mysql_server_end'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::_TransactionCmd(char const*)':
DatabaseMysql.cpp:(.text+0x2f4): undefined reference to `mysql_query'
DatabaseMysql.cpp:(.text+0x387): undefined reference to `mysql_error'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::DirectExecute(char const*)':
DatabaseMysql.cpp:(.text+0x517): undefined reference to `mysql_query'
DatabaseMysql.cpp:(.text+0x542): undefined reference to `mysql_error'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::_Query(char const*, st_mysql_res**, st_mysql_field**, unsigned long*, unsigned int*)':
DatabaseMysql.cpp:(.text+0x71a): undefined reference to `mysql_query'
DatabaseMysql.cpp:(.text+0x745): undefined reference to `mysql_error'
DatabaseMysql.cpp:(.text+0x87a): undefined reference to `mysql_store_result'
DatabaseMysql.cpp:(.text+0x88a): undefined reference to `mysql_affected_rows'
DatabaseMysql.cpp:(.text+0x89a): undefined reference to `mysql_field_count'
DatabaseMysql.cpp:(.text+0x8d5): undefined reference to `mysql_fetch_fields'
DatabaseMysql.cpp:(.text+0x911): undefined reference to `mysql_free_result'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::Initialize(char const*)':
DatabaseMysql.cpp:(.text+0xa2e): undefined reference to `mysql_init'
DatabaseMysql.cpp:(.text+0xc12): undefined reference to `mysql_options'
DatabaseMysql.cpp:(.text+0xc9e): undefined reference to `mysql_real_connect'
DatabaseMysql.cpp:(.text+0xd44): undefined reference to `mysql_get_client_info'
DatabaseMysql.cpp:(.text+0xdb3): undefined reference to `mysql_get_server_info'
DatabaseMysql.cpp:(.text+0xe27): undefined reference to `mysql_autocommit'
DatabaseMysql.cpp:(.text+0xfdd): undefined reference to `mysql_options'
DatabaseMysql.cpp:(.text+0x1075): undefined reference to `mysql_error'
DatabaseMysql.cpp:(.text+0x10f0): undefined reference to `mysql_close'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::DatabaseMysql()':
DatabaseMysql.cpp:(.text+0x168a): undefined reference to `mysql_server_init'
DatabaseMysql.cpp:(.text+0x168f): undefined reference to `mysql_thread_safe'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::escape_string(char*, char const*, unsigned long)':
DatabaseMysql.cpp:(.text+0x1a6): undefined reference to `mysql_real_escape_string'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::ThreadEnd()':
DatabaseMysql.cpp:(.text+0x2c1): undefined reference to `mysql_thread_end'
../shared/Database/libmangosdatabase.a(DatabaseMysql.o): In function `DatabaseMysql::ThreadStart()':
DatabaseMysql.cpp:(.text+0x2d1): undefined reference to `mysql_thread_init'
../shared/Database/libmangosdatabase.a(QueryResultMysql.o): In function `QueryResultMysql::EndQuery()':
QueryResultMysql.cpp:(.text+0x58): undefined reference to `mysql_free_result'
../shared/Database/libmangosdatabase.a(QueryResultMysql.o): In function `QueryResultMysql::NextRow()':
QueryResultMysql.cpp:(.text+0x83): undefined reference to `mysql_fetch_row'
../shared/Database/libmangosdatabase.a(SqlDelayThread.o): In function `SqlDelayThread::run()':
SqlDelayThread.cpp:(.text+0x30): undefined reference to `mysql_thread_init'
SqlDelayThread.cpp:(.text+0x127): undefined reference to `mysql_thread_end'
collect2: ld returned 1 exit status

To compile MaNGOS I use the following steps after pulling from git and aplying the sd2 patch:

autoreconf --install --force
mkdir objdir
cd objdir
../configure --prefix=/home/****/mserver --sysconfdir=/home/****/mserver/etc --enable-cli --enable-ra --datadir=/home/****/mserver/data

# for dual core support on make, make install add "-j2"
make -j2

The conf log says:

checking whether to build/link POSTGRESQL... no
checking whether to build/link MYSQL... yes
checking for mysql_config... /usr/bin/mysql_config
configure: WARNING: Your mysql libs contains -Wl,--as-needed, this is not good, problem fixed in more recent mysql versions
...
checking mysql.h usability... yes
checking mysql.h presence... yes
checking for mysql.h... yes
checking mysql/mysql.h usability... yes
checking mysql/mysql.h presence... yes
checking for mysql/mysql.h... yes

Output of mysql-conf is:

Usage: /usr/bin/mysql_config [OPTIONS]
Options:
       --cflags         [-I/usr/include/mysql  -fPIC -pipe -fno-strict-aliasing   -DUNIV_LINUX -DUNIV_LINUX]
       --include        [-I/usr/include/mysql]
       --libs           [-Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm]
       --libs_r         [-Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -L/usr/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread]
       --plugindir      [/usr/lib/mysql/plugin]
       --socket         [/var/run/mysqld/mysqld.sock]
       --port           [0]
       --version        [5.1.46]
       --libmysqld-libs [-Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -L/usr/lib/mysql -lmysqld -ldl -lz -lpthread -lcrypt -lnsl -lm -lpthread -lwrap -lrt]

Thanks for helping me :)

EDIT: SOLVED the problem by editing /src/shared/DatabaseMysql.h AND /src/shared/QueryResultMysql.h in the following way.

Replace:

#ifdef WIN32
#include <winsock2.h>
#include <mysql/mysql.h>
#else
#include <mysql.h>
#endif

with:

#ifdef WIN32
#include <winsock2.h>
#include <mysql/mysql.h>
#else
#include <mysql/mysql.h>
#endif

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use