You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Raul Salitrero <ra...@gmail.com> on 2010/12/23 22:25:32 UTC

Re: [PATCH] Fix apr_dbd_mysql link error on windows


Dongsheng Song <dongsheng <at> apache.org> writes:

> 
> 
> In function dbd_mysql_init, there have
a function call (my_init) which does not 
export in libmysql.dll(mysql-connector-c-6.0.2).
So we got link error:apr_dbd_mysql.obj :
error LNK2019: unresolved external 
symbol _my_init referenced in function 
_dbd_mysql_init
> 
> .\Release\apr_dbd_mysql-1.dll : 
fatal error LNK1120: 1 unresolved externalsAs
in dbd_mysql_open, we call mysql_init, 

which call mysql_server_init, then
mysql_server_init call my_init,so 
we need not to direct call my_init.This issues
exists in 1.3.x, 1.4.x, 1.5.x and trunk.Index:
apr_dbd_mysql.c

==========================================================
apr_dbd_mysql.c     (revision 943816)+++ apr_dbd_mysql.c   
  (working copy)
> 
>  <at>  <at>  -1284,7 +1284,6  <at>  <at>  static void
dbd_mysql_init(apr_pool_t *pool) {-    my_init();    
 mysql_thread_init();    
/* FIXME: this is a guess; find out what it really does */Regards,
> 
> Dongsheng
>    


i have tested this patch, it does compile, but 
then apache crashes when calling dbd_mysql_init

i found the solution to call mysql_init() and 
then destroy the created object with mysql_close()
 i left it like this, and now it works apparently 
with no problems.

MYSQL * temp_ptr = NULL;
temp_ptr = mysql_init(temp_ptr);
mysql_thread_init();
mysql_close(temp_ptr);