Bug #30118 Debug version of static client library on Windows lacks symbols
Submitted: 29 Jul 2007 9:50 Modified: 6 Aug 2007 19:33
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S2 (Serious)
Version:5.0.46 OS:Windows
Assigned to: Kent Boortz CPU Architecture:Any

[29 Jul 2007 9:50] Kent Boortz
Description:
Trying to link an application with "lib\opt\mysqlclient.lib"
will show missing symbols, missing "zlib"

mysqlclient.lib(my_compress.obj) : error LNK2019: unresolved external symbol _compress referenced in function _my_compress_alloc
mysqlclient.lib(my_compress.obj) : error LNK2019: unresolved external symbol _uncompress referenced in function _my_uncompress

Linking with the debug version, "lib\debug\mysqlclient.lib" will show
it lacks "zlib" as well, but also it lacks "dbug"

mysqlclient.lib(libmysql.obj) : error LNK2019: unresolved external symbol __db_push_ referenced in function _mysql_debug@4
mysqlclient.lib(libmysql.obj) : error LNK2001: unresolved external symbol __no_db_
mysqlclient.lib(my_fopen.obj) : error LNK2001: unresolved external symbol __db_on_
.
.
.

How to repeat:
Try use the static library as stated in the User Manual. The "dbug.lib"
is not even part of the package, so no work around if need to use the
debug library. The work around for the static non debug packages is to
link with the bundled "zlib.lib" in addition to "mysqlclient.lib".
[29 Jul 2007 10:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31773

ChangeSet@1.2485, 2007-07-29 12:43:47+02:00, kent@mysql.com +9 -0
  make_win_bin_dist, CMakeLists.txt (many):
  
  - Made Windows client libraries pass linkage testing, both normal and
    debug libraries (bug#30118).
  
  - Made build closer to Unix build.
  
  - Removed code duplication.
  
  - Made separation between TLS and non TLS linkage clearer.
  
  - Removed redundant libraries from client linkage in the build itself,
    to force build errors when "mysqlclient.lib" is incomplete.
[2 Aug 2007 10:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32008

ChangeSet@1.2485, 2007-08-02 12:49:27+02:00, kent@mysql.com +8 -0
  CMakeLists.txt (several), make_win_bin_dist:
    Aligned client library build and use with the Unix version when it
    comes to what source to include directly in the builds, and what
    libraries to link with (bug#30118).
  
    Also reviewed, corrected and made more clear when static or dynamic
    Thread Local Storage is to be used. Some code duplication was removed,
    and some redundant library usage were removed, reducing the risk of
    incorrect TLS usage.
[2 Aug 2007 13:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32010

ChangeSet@1.2576, 2007-08-02 15:37:33+02:00, kent@mysql.com +10 -0
  Makefile.am:
    Add CMakeLists.txt to source distribution
  CMakeLists.txt:
    Added missing '${MYSQLD_EXE_SUFFIX}' to "mysqld" targets new in 5.1
    Manual merge from 5.0 (bug#30118)
  CMakeLists.txt, mysqlbinlog.cc, lib_sql.cc:
    No need to test on USING_CMAKE, it is the only Windows build
[3 Aug 2007 9:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32053

ChangeSet@1.2591, 2007-08-03 11:06:53+02:00, joerg@trift2. +5 -0
  Re-apply fixes originally made by Kent, 
  they got lost because of a merge conflict with the CMakeLists.txt 
  dependency fix (numer 29982 in our bugs DB).
  
  These changes are for bug#30118.
[3 Aug 2007 19:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32088

ChangeSet@1.2504, 2007-08-03 21:51:37+02:00, kent@mysql.com +14 -0
  CMakeLists.txt, README, configure.js
    Several adjustments to make client libraries pass the link test
    on both win32 and winx64, Visual Studio 2003 and 2005 (bug#30118)
[6 Aug 2007 18:13] Bugs System
Pushed into 5.1.21-beta
[6 Aug 2007 18:14] Bugs System
Pushed into 5.0.48
[6 Aug 2007 19:33] Paul DuBois
Noted in 5.0.48, 5.1.21 changelogs.

On Windows, client libraries lacked symbols required for linking.