You are not logged in.

#1 2010-08-20 01:03:43

THCMyst
Member
Registered: 2010-08-20
Posts: 11

Coding issue

So I'm not sure About this, I develop for a emulated wow server, and recently fixed compiling for linux. So I ran it on Slackware 13 x64, and it compiled with no issue. Well, I prefer Arch over Slack, so I decided to do the switch. Then I ran across these issues. Now I figure it should be a linking issue, but It has a check for mysql

# Check for mysql
MYSQL_FOUND=AX_LIB_MYSQL([5.0])
if test "$MYSQL_VERSION" = ""; then
    AC_MSG_ERROR([*** mysql client library not found. Please install it.])
else 
    LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
    CFLAGS="$CFLAGS $MYSQL_CFLAGS"
    CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
fi

And the check seems to find the Mysql client lib, so no problem.

configure.ac makes the makefile

MYSQL_CFLAGS = -I/usr/include/mysql  -fPIC -pipe -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer   -DUNI$
MYSQL_CONFIG = /usr/bin/mysql_config
MYSQL_LDFLAGS = -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl $
MYSQL_VERSION = 5.1.47

So obviously its grabbing the information needed, so I'm not exactly understanding what's going on.

Database.cpp:(.text+0x1e6f): undefined reference to `mysql_real_escape_string'
/trunk/src/hearthstone-shared/libshared.a(Database.o): In function `Database::EscapeString(char const*, DatabaseConnection*)':
Database.cpp:(.text+0x1f33): undefined reference to `mysql_real_escape_string'
/trunk/src/hearthstone-shared/libshared.a(Database.o): In function `Database::_SendQuery(DatabaseConnection*, char const*, bool)':
Database.cpp:(.text+0x1ff9): undefined reference to `mysql_query'
Database.cpp:(.text+0x2025): undefined reference to `mysql_errno'
Database.cpp:(.text+0x2089): undefined reference to `mysql_error'
/trunk/src/hearthstone-shared/libshared.a(Database.o): In function `QueryResult::~QueryResult()':
Database.cpp:(.text+0x2186): undefined reference to `mysql_free_result'
/trunk/src/hearthstone-shared/libshared.a(Database.o): In function `QueryResult::NextRow()':
Database.cpp:(.text+0x21c4): undefined reference to `mysql_fetch_row'
/trunk/src/hearthstone-shared/libshared.a(Database.o): In function `Database::_StoreQueryResult(DatabaseConnection*)':
Database.cpp:(.text+0x2251): undefined reference to `mysql_store_result'
Database.cpp:(.text+0x2266): undefined reference to `mysql_affected_rows'
Database.cpp:(.text+0x227a): undefined reference to `mysql_field_count'
Database.cpp:(.text+0x22a9): undefined reference to `mysql_free_result'
/trunk/src/hearthstone-shared/libshared.a(Database.o): In function `Database::_Reconnect(DatabaseConnection*)':
Database.cpp:(.text+0x232a): undefined reference to `mysql_init'
Database.cpp:(.text+0x23c0): undefined reference to `mysql_real_connect'
Database.cpp:(.text+0x23da): undefined reference to `mysql_error'
Database.cpp:(.text+0x240d): undefined reference to `mysql_close'
Database.cpp:(.text+0x2428): undefined reference to `mysql_query'
Database.cpp:(.text+0x2447): undefined reference to `mysql_close'

Anyone have an idea? I can setup a x86 compile and see where it goes as well.

Last edited by Inxsible (2010-08-20 02:04:42)

Offline

#2 2010-08-20 02:03:37

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Coding issue

using the code tags provided by the forum helps in readability.

Edited your post to add the code tags.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2010-08-20 15:55:17

THCMyst
Member
Registered: 2010-08-20
Posts: 11

Re: Coding issue

Sorry about that, not used to these forums, used to code tags, saw the bbcode and wasn't sure if that was for something else.

Offline

#4 2010-08-21 03:57:52

THCMyst
Member
Registered: 2010-08-20
Posts: 11

Re: Coding issue

Sorry for double post, but could this be moved into the programming section, I seemed to have missed it when I created the topic.

Offline

#5 2010-08-21 04:05:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Coding issue

Moved...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2010-08-21 04:32:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,294

Re: Coding issue

Two suggestions, but no guarantees.

Did you do an aclocal prior to autoconf?
You might also try reversing the order of LDFLAGS my putting  $MYSQL_LDFLAGS before $LDFLAGS

YMMV


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB