[CONC-114] mariadbclient.lib doesn't have all symbols. Created: 2014-11-13  Updated: 2014-12-09

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Abhishek Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Visual studio 2010 on Windows 8 Cmake version-2.8.11.2.


Issue Links:
Relates
relates to CONC-111 not all API symbols are exported Closed

 Description   

First Compilation fails on my setup for mariadbclient revision 160 using Cmake .
If I making following changes, mariadbclient compiles fine-
In /include/my_global.h -
change
" #ifndef _SIZE_T_DEFINED
typedef SSIZE_T ssize_t;
#endif"
to
" #ifdef _SIZE_T_DEFINED
typedef SSIZE_T ssize_t;
#endif"
After building mariadbclient this way I get linking error for some symbols like mysql_client_find_plugin, mysql_client_register_plugin. Specificaly I am getting following error-"error LNK2019: unresolved external symbol "struct st_mysql_client_plugin * __cdecl mysql_client_find_plugin(struct st_mysql *,char const *,int)" (?mysql_client_find_plugin@@YAPAUst_mysql_client_plugin@@PAUst_mysql@@PBDH@Z)"
I also observed that all other symbols which I use to execute query, connecting to mysql etc are working correctly as before. I face this issue only when I use functions related to plugin



 Comments   
Comment by Abhishek [ 2014-11-14 ]

This issue is not fixed in revision-166. I am getting same 'external symbol not found' error.

Comment by Georg Richter [ 2014-12-09 ]

I'm not able to reproduce it:

bzr log -l1
------------------------------------------------------------
revno: 166
committer: Georg Richter <georg@mariadb.com>
branch nick: rc1
timestamp: Thu 2014-11-13 13:54:45 +0100
message:
  Fix for CONC-114: Windows version of libmariadb doesn't export all symbols

dumpbin /exports libmariadb.dll | findstr plugin
     34   21 00001370 mysql_client_find_plugin = @ILT+875(_mysql_client_find_plugin@12)
         35   22 000011DB mysql_client_register_plugin = @ILT+470(_mysql_client_register_plugin@8)
         98   61 00001712 mysql_load_plugin = @ILT+1805(_mysql_load_plugin)
         99   62 000012B7 mysql_load_plugin_v = @ILT+690(_mysql_load_plugin_v@20)
 
dumpbin /exports libmariadb.lib | findstr plugin
                  _mysql_client_find_plugin@12
                  _mysql_client_register_plugin@8
                  _mysql_load_plugin
                  _mysql_load_plugin_v@20
                  _mysql_client_find_plugin@12
                  _mysql_client_register_plugin@8
                  _mysql_load_plugin
                  _mysql_load_plugin_v@20

Test program (added in rev. 167)

static int test_conc_114(MYSQL *mysql)
{
  if (mysql_client_find_plugin(mysql, "foo", 0))
  {
    diag("Null pointer expected");
    return FAIL;
  }
  diag("Error: %s", mysql_error(mysql));
  return OK;
}

Comment by Abhishek [ 2014-12-09 ]

In Test program (added in rev. 167)

static int test_conc_114(MYSQL *mysql)
{
if (mysql_client_find_plugin(mysql, "foo", 0))

{ diag("Null pointer expected"); return FAIL; }

diag("Error: %s", mysql_error(mysql));
return OK;
}

output-
3>------ Build started: Project: misc, Configuration: Debug Win32 ------
3> Building Custom Rule E:/MOnyog/Documents/mariadbclient_newrev_12-09-2014/unittest/libmariadb/CMakeLists.txt
3> CMake does not need to re-run because E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\CMakeFiles\generate.stamp is up-to-date.
3> misc.c
3>misc.c(834): warning C4244: '=' : conversion from 'my_ulonglong' to 'int', possible loss of data
3>misc.c(953): warning C4244: '=' : conversion from 'my_ulonglong' to 'int', possible loss of data
3>misc.c(976): warning C4013: 'mysql_client_find_plugin' undefined; assuming extern returning int
3>misc.obj : error LNK2019: unresolved external symbol _mysql_client_find_plugin referenced in function _test_conc_114
3>E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\Debug\misc.exe : fatal error LNK1120: 1 unresolved externals

error-
Error 4 error LNK2019: unresolved external symbol _mysql_client_find_plugin referenced in function _test_conc_114 E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\misc.obj misc
Error 5 error LNK1120: 1 unresolved externals E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\Debug\misc.exe 1 1 misc
6 IntelliSense: identifier "mysql_client_find_plugin" is undefined e:\monyog\documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\misc.c 976 7 misc

Comment by Georg Richter [ 2014-12-09 ]

Did you branch a new tree from launchpad or did you just pull rev. 167? If latter one, try to remove CMakeCache.txt and run cmake again.

Comment by Abhishek [ 2014-12-09 ]

I branch a new tree.

Revision:
167 revid:georg@mariadb.com-20141209101344-e861a4dj71qja0l1
Parents:
166: Fix for CONC-114: Windows version of libmariadb doesn't exp…
Date:
12/9/2014 3:43:44 PM
Committer:
Georg Richter <georg@mariadb.com>
Branch:
mariadb-native-client

Added test case for conc-114

Comment by Georg Richter [ 2014-12-09 ]

my fault: pushed from wrong tree (on linux tree #include <mysql/client_plugin.h>) was missing in misc.c.
Please do a bzr uncommit and bzr pull to get rev. 167 again.

This might be also the cause for your problems: In your appllication you need to explicitly include <mysql/client_plugin.h>-

Comment by Abhishek [ 2014-12-09 ]

Revision:
167 revid:georg@mariadb.com-20141209115509-2e6ryt6v2gd99tb0
Parents:
166: Fix for CONC-114: Windows version of libmariadb doesn't exp…
Date:
12/9/2014 5:25:09 PM
Committer:
Georg Richter <georg@mariadb.com>
Branch:
mariadb-native-client

Added test case for conc-114

output-
4>------ Build started: Project: misc, Configuration: Debug Win32 ------
4> Building Custom Rule E:/MOnyog/Documents/mariadbclient_newrev_12-09-2014/unittest/libmariadb/CMakeLists.txt
4> CMake does not need to re-run because E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\CMakeFiles\generate.stamp is up-to-date.
4> misc.c
4>misc.c(834): warning C4244: '=' : conversion from 'my_ulonglong' to 'int', possible loss of data
4>misc.c(953): warning C4244: '=' : conversion from 'my_ulonglong' to 'int', possible loss of data
4>misc.c(976): warning C4013: 'mysql_client_find_plugin' undefined; assuming extern returning int
4>misc.obj : error LNK2019: unresolved external symbol _mysql_client_find_plugin referenced in function _test_conc_114
4>E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\Debug\misc.exe : fatal error LNK1120: 1 unresolved externals

error-
Error 5 error LNK2019: unresolved external symbol _mysql_client_find_plugin referenced in function _test_conc_114 E:\MOnyog\Documents\mariadbclient_newrev_12-09-2014\unittest\libmariadb\misc.obj misc

I included <mysql/client_plugin.h> in my application.

Generated at Thu Feb 08 03:02:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.