Bug #11423 link errors compiling ssl support
Submitted: 18 Jun 2005 6:34 Modified: 20 Jun 2005 13:14
Reporter: hormuzd irani Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:4.1.12 OS:Microsoft Windows (win98se)
Assigned to: CPU Architecture:Any

[18 Jun 2005 6:34] hormuzd irani
Description:
compiling without ssl support went smothly and works fine..

while compiling with ssl support under vc++6 with openssl versions 0.9.7g and 0.9.6m i get the following link errors:

Linking...
client.obj : error LNK2001: unresolved external symbol _sslconnect
client.obj : error LNK2001: unresolved external symbol _new_VioSSLConnectorFd
item_strfunc.obj : error LNK2001: unresolved external symbol "struct st_des_keyschedule *  des_keyschedule" (?des_keyschedule@@3PAUst_des_keyschedule@@A)
item_strfunc.obj : error LNK2001: unresolved external symbol "unsigned int  des_default_key" (?des_default_key@@3IA)
item_strfunc.obj : error LNK2001: unresolved external symbol "struct _RTL_CRITICAL_SECTION  LOCK_des_key_file" (?LOCK_des_key_file@@3U_RTL_CRITICAL_SECTION@@A)
mysqld.obj : error LNK2001: unresolved external symbol "void __cdecl free_des_key_file(void)" (?free_des_key_file@@YAXXZ)
mysqld.obj : error LNK2001: unresolved external symbol "int __cdecl load_des_key_file(char const *)" (?load_des_key_file@@YAHPBD@Z)
mysqld.obj : error LNK2001: unresolved external symbol _new_VioSSLAcceptorFd
sql_parse.obj : error LNK2001: unresolved external symbol _sslaccept
../client_debug/mysqld-debug.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.

mysqld-debug.exe - 10 error(s), 0 warning(s)
----------------------------------------------------------------------------

if i donot include the 2 openssl libraries (ssleay32.lib , libeay32.lib) while linking i get the following errors :

--------------------Configuration: mysqld - Win32 Release--------------------
Compiling...
client.c
Linking...
client.obj : error LNK2001: unresolved external symbol _sslconnect
client.obj : error LNK2001: unresolved external symbol _new_VioSSLConnectorFd
item_strfunc.obj : error LNK2001: unresolved external symbol _DES_ede3_cbc_encrypt
item_strfunc.obj : error LNK2001: unresolved external symbol _DES_set_key_unchecked
item_strfunc.obj : error LNK2001: unresolved external symbol _EVP_BytesToKey
item_strfunc.obj : error LNK2001: unresolved external symbol _EVP_des_ede3_cbc
item_strfunc.obj : error LNK2001: unresolved external symbol _EVP_md5
item_strfunc.obj : error LNK2001: unresolved external symbol "struct st_des_keyschedule *  des_keyschedule" (?des_keyschedule@@3PAUst_des_keyschedule@@A)
item_strfunc.obj : error LNK2001: unresolved external symbol "unsigned int  des_default_key" (?des_default_key@@3IA)
item_strfunc.obj : error LNK2001: unresolved external symbol "struct _RTL_CRITICAL_SECTION  LOCK_des_key_file" (?LOCK_des_key_file@@3U_RTL_CRITICAL_SECTION@@A)
mysqld.obj : error LNK2001: unresolved external symbol "void __cdecl free_des_key_file(void)" (?free_des_key_file@@YAXXZ)
mysqld.obj : error LNK2001: unresolved external symbol "int __cdecl load_des_key_file(char const *)" (?load_des_key_file@@YAHPBD@Z)
mysqld.obj : error LNK2001: unresolved external symbol _new_VioSSLAcceptorFd
sql_acl.obj : error LNK2001: unresolved external symbol _X509_get_subject_name
sql_acl.obj : error LNK2001: unresolved external symbol _X509_NAME_oneline
sql_acl.obj : error LNK2001: unresolved external symbol _X509_get_issuer_name
sql_acl.obj : error LNK2001: unresolved external symbol _SSL_CIPHER_get_name
sql_show.obj : error LNK2001: unresolved external symbol _SSL_CIPHER_get_name
sql_acl.obj : error LNK2001: unresolved external symbol _SSL_get_current_cipher
sql_show.obj : error LNK2001: unresolved external symbol _SSL_get_current_cipher
sql_acl.obj : error LNK2001: unresolved external symbol _SSL_get_peer_certificate
sql_acl.obj : error LNK2001: unresolved external symbol _SSL_get_verify_result
sql_parse.obj : error LNK2001: unresolved external symbol _sslaccept
sql_show.obj : error LNK2001: unresolved external symbol _SSL_get_verify_depth
sql_show.obj : error LNK2001: unresolved external symbol _SSL_get_verify_mode
sql_show.obj : error LNK2001: unresolved external symbol _SSL_get_default_timeout
sql_show.obj : error LNK2001: unresolved external symbol _SSL_ctrl
sql_show.obj : error LNK2001: unresolved external symbol _SSL_get_version
sql_show.obj : error LNK2001: unresolved external symbol _SSL_CTX_get_verify_depth
sql_show.obj : error LNK2001: unresolved external symbol _SSL_CTX_get_verify_mode
sql_show.obj : error LNK2001: unresolved external symbol _SSL_CTX_ctrl
../client_release/mysqld.exe : fatal error LNK1120: 29 unresolved externals
Error executing link.exe.

mysqld.exe - 32 error(s), 0 warning(s)

How to repeat:
compile with ssl support under vc++6
[20 Jun 2005 6:01] hormuzd irani
the first 2 and last 2 link errors eliminated by passing HAVE_SSL decleration to vio and other projects. 

think the balance errors are due to using vc++6 without sp installed.

should vc++7 be used?
[20 Jun 2005 6:10] hormuzd irani
the definition is HAVE_OPENSSL and not OPEN_SSL as reported by mistake earlier.
[20 Jun 2005 13:14] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for 
asking help on using MySQL products. Your problem is not the result 
of a bug.

Support on using our products is available both free in our forums
at http://forums.mysql.com and for a reasonable fee direct from our
skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.
[22 Jun 2005 6:41] hormuzd irani
tried compiling again after installing sp5 on vc++6

i still get 5 link errors as mention earlier
[23 Jun 2005 7:51] hormuzd irani
managed to compile mysql with SSL support under win98

the file    des_key_file.cpp was not included in mysqld project, so it was added.

also made the following change in file des_key_file.cpp :

include <mysql_priv.h>      replaced as:

include "mysql_priv.h"