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

altalus
Posts: 136
Joined: Wed Nov 14, 2012 8:31 pm
Location: Montreal Qc, CAN

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

Post by altalus » Sun Nov 16, 2014 4:42 pm

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? :)
Last edited by altalus on Sun Nov 16, 2014 10:36 pm, edited 1 time in total.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Sun Nov 16, 2014 5:19 pm

looks like you don't have everything setup as it should for the mysql devel libs (wrong package?)

altalus
Posts: 136
Joined: Wed Nov 14, 2012 8:31 pm
Location: Montreal Qc, CAN

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

Post by altalus » Sun Nov 16, 2014 5:39 pm

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 ? :-/

norfolks maddest man
Posts: 5
Joined: Fri Nov 14, 2014 2:34 pm

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

Post by norfolks maddest man » Sun Nov 16, 2014 6:02 pm

libmysqlclient-dev

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Sun Nov 16, 2014 6:15 pm

libmysqlclient-dev i think

altalus
Posts: 136
Joined: Wed Nov 14, 2012 8:31 pm
Location: Montreal Qc, CAN

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

Post by altalus » Sun Nov 16, 2014 6:26 pm

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
[...]

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Sun Nov 16, 2014 6:39 pm

14.04.1 LTS x64 is what i use

altalus
Posts: 136
Joined: Wed Nov 14, 2012 8:31 pm
Location: Montreal Qc, CAN

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

Post by altalus » Sun Nov 16, 2014 6:44 pm

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? :)

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Sun Nov 16, 2014 7:29 pm

yes, x64 is supported now on both linux and windows

altalus
Posts: 136
Joined: Wed Nov 14, 2012 8:31 pm
Location: Montreal Qc, CAN

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

Post by altalus » Sun Nov 16, 2014 7:48 pm

Ok, I'll re-image the VM with a x64 version and I'll try to re-build the servers. thank you :)

Post Reply