Bug #47402 MySQL 5.1.34 mysqlclient.lib gives error on compilation.
Submitted: 17 Sep 2009 9:06 Modified: 21 Sep 2009 12:30
Reporter: Amit Bora Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.1.34 OS:Windows
Assigned to: CPU Architecture:Any

[17 Sep 2009 9:06] Amit Bora
Description:
when I use "mysqlclient.lib" (mysql 5.1.34) on windows in my code and trying to compile the code it gives error as:

mysqlclient.lib(trees.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(inftrees.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(aes.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(random.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(asn.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(md2.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(ctype-tis620.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(integer.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(misc.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(des.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(mf_loadpath.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(xml.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(ctype-ucs2.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(mf_qsort.obj) : error LNK2001: unresolved external symbol ___security_cookie
mysqlclient.lib(yassl_imp.obj) : error LNK2001: unresolved external symbol ___security_cookie

when I include "libmysql.lib" it is compile successfully. But for linking I need to have MySQL 5.1.34 version installed on machine to remote access of MySQL server or need to copy 'libmysql.dll".

I don't want to use libmysql.lib as I don't have to install or copy "dll".

So Is there any way to use "mysqlclient.lib" successfully.

How to repeat:
Compile the any sample code just to connect to mysql server using reference of mysqlclient.lib as external library.
[17 Sep 2009 9:44] Peter Laursen
I think you should tell the compiler version. 

We had such problems (if I understand) depending on the Visual Studio version and the .lib version used. We had to recompile the 5.1.38 .lib on VS2003 (it worked out of the box on VS2008 and also some not quite recent 5.0.x .lib worked out of the box on VS2003).  I do not know if MySQL changed their Windows build environment.

Peter
(not a MySQL person)
[17 Sep 2009 10:10] Amit Bora
I am building my code using Visual Studio 6.0 compiler on Windows 2000 server machine.
[17 Sep 2009 10:13] Sveta Smirnova
Thank you for the report.

Please provide your compiler version and command you use to compile (or linking options if you use graphic interface). Also, please, try current version 5.1.38 as this can be fixed already.
[17 Sep 2009 11:26] Amit Bora
I have used following link options:

mysqlclient.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"../tryD.pdb" /debug /machine:I386 /nodefaultlib:"libcmt.lib" /out:"../try.dll" /implib:"Debug/tryD.lib" /pdbtype:sept /libpath:"../MySQL5134/lib/" /libpath:"
[21 Sep 2009 12:30] MySQL Verification Team
I couldn't repeat with current source tree. Compiled with VS2005 and:

c:\build\mysql-5.1\mysql-test>cmake --version
cmake version 2.6-patch 3

c:\build\mysql-5.1\mysql-test>bison --version
GNU Bison version 1.28

c:\build\mysql-5.1\mysql-test>