Page 1 of 2

[Fixed] Compile error with mysql libs on an Ubuntu 14.04.1

Posted: Sun Nov 16, 2014 4:42 pm
by altalus
Hello everyone,

I a moving servers and this new one is an Ubuntu 14.04.1 LTS x86. I installed all the libs (at last I think that I did) and get this error when compiling:

Code: Select all

dsgame-sql.o: In function `Sql_Malloc()':
/home/guillaume/Vejiitasei/src/common/sql.cpp:76: undefined reference to `mysql_init'
dsgame-sql.o: In function `Sql_Connect(Sql_t*, char const*, char const*, char const*, unsigned short, char const*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:96: undefined reference to `mysql_real_connect'
/home/guillaume/Vejiitasei/src/common/sql.cpp:98: undefined reference to `mysql_error'
dsgame-sql.o: In function `Sql_SetEncoding(Sql_t*, char const*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:172: undefined reference to `mysql_set_character_set'
dsgame-sql.o: In function `Sql_Ping(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:187: undefined reference to `mysql_ping'
dsgame-sql.o: In function `Sql_NextRow(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:408: undefined reference to `mysql_fetch_row'
/home/guillaume/Vejiitasei/src/common/sql.cpp:411: undefined reference to `mysql_fetch_lengths'
/home/guillaume/Vejiitasei/src/common/sql.cpp:415: undefined reference to `mysql_errno'
dsgame-sql.o: In function `Sql_NumColumns':
/home/guillaume/Vejiitasei/src/common/sql.cpp:378: undefined reference to `mysql_num_fields'
/home/guillaume/Vejiitasei/src/common/sql.cpp:378: undefined reference to `mysql_num_fields'
/home/guillaume/Vejiitasei/src/common/sql.cpp:378: undefined reference to `mysql_num_fields'
/home/guillaume/Vejiitasei/src/common/sql.cpp:378: undefined reference to `mysql_num_fields'
/home/guillaume/Vejiitasei/src/common/sql.cpp:378: undefined reference to `mysql_num_fields'
dsgame-sql.o: In function `Sql_FreeResult(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:536: undefined reference to `mysql_free_result'
dsgame-sql.o: In function `Sql_QueryV(Sql_t*, char const*, char*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:295: undefined reference to `mysql_real_query'
/home/guillaume/Vejiitasei/src/common/sql.cpp:300: undefined reference to `mysql_store_result'
/home/guillaume/Vejiitasei/src/common/sql.cpp:301: undefined reference to `mysql_errno'
/home/guillaume/Vejiitasei/src/common/sql.cpp:303: undefined reference to `mysql_error'
dsgame-sql.o: In function `Sql_QueryStr(Sql_t*, char const*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:323: undefined reference to `mysql_real_query'
/home/guillaume/Vejiitasei/src/common/sql.cpp:328: undefined reference to `mysql_store_result'
/home/guillaume/Vejiitasei/src/common/sql.cpp:329: undefined reference to `mysql_errno'
/home/guillaume/Vejiitasei/src/common/sql.cpp:331: undefined reference to `mysql_error'
dsgame-sql.o: In function `Sql_Free(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:571: undefined reference to `mysql_close'
dsgame-sql.o: In function `Sql_NumRows':
/home/guillaume/Vejiitasei/src/common/sql.cpp:393: undefined reference to `mysql_num_rows'
dsgame-sql.o: In function `Sql_TransactionCommit(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:624: undefined reference to `mysql_commit'
dsgame-sql.o: In function `Sql_EscapeStringLen(Sql_t*, char*, char const*, unsigned int)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:247: undefined reference to `mysql_real_escape_string'
/home/guillaume/Vejiitasei/src/common/sql.cpp:249: undefined reference to `mysql_escape_string'
dsgame-sql.o: In function `Sql_AffectedRows(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:347: undefined reference to `mysql_affected_rows'
dsgame-sql.o: In function `Sql_LastInsertId(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:363: undefined reference to `mysql_insert_id'
dsgame-sql.o: In function `Sql_NumColumns(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:378: undefined reference to `mysql_num_fields'
dsgame-sql.o: In function `Sql_NumRows(Sql_t*)':
/home/guillaume/Vejiitasei/src/common/sql.cpp:393: undefined reference to `mysql_num_rows'
collect2: error: ld returned 1 exit status
make: *** [dsgame] Error 1
I am pretty sure I have everything setup as it should for the mysql devel libs... help? :)

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 5:19 pm
by kjLotus
looks like you don't have everything setup as it should for the mysql devel libs (wrong package?)

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 5:39 pm
by altalus
I thought so myself but I seems to have installed them all from the official repos. Do you have the name of the exact one I should have ? :-/

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 6:02 pm
by norfolks maddest man
libmysqlclient-dev

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 6:15 pm
by kjLotus
libmysqlclient-dev i think

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 6:26 pm
by altalus
Yup, already there...

Code: Select all

Reading package lists... Done
Building dependency tree
Reading state information... Done
libmysqlclient-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I wonder if 14.04.1 was tested by someone ?

I seems to have weird warning from autogen also:

Code: Select all

[...]
configure.ac:152: the top level
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
sources.am:1: warning: source file 'src/common/blowfish.cpp' is in a subdirectory,
sources.am:1: but option 'subdir-objects' is disabled
Makefile.am:5:   'sources.am' included from here
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
[...]

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 6:39 pm
by kjLotus
14.04.1 LTS x64 is what i use

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 6:44 pm
by altalus
oh, wasn't x64 causing lots of errors with the server? I know you could compile as x86 in an x64 machine but my tests were not really good. Was it fixed and we can compile as x64 bin now? :)

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 7:29 pm
by kjLotus
yes, x64 is supported now on both linux and windows

Re: Compile error with mysql libs on an Ubuntu Ubuntu 14.04.

Posted: Sun Nov 16, 2014 7:48 pm
by altalus
Ok, I'll re-image the VM with a x64 version and I'll try to re-build the servers. thank you :)