사내에서 개발중인 제품을 테스트하기 위해 컴파일을 하던 도중, 아래의 오류를 발견했다. mysqlclient 라이브러리를 함께 사용하는 부분이 있었는데, Linking 을 하던 도중 에러가 발생한 것이다.

/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_close_free_options’:
(.text+0xd7d): undefined reference to `SSL_CTX_free’
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_get_ssl_cipher’:
(.text+0x1081): undefined reference to `SSL_get_current_cipher’
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_real_connect’:
(.text+0x3a4c): undefined reference to `SSL_get_peer_certificate’
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_real_connect’:
(.text+0x3a60): undefined reference to `X509_get_subject_name’
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_real_connect’:
(.text+0x3a74): undefined reference to `X509_NAME_oneline’
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_real_connect’:
(.text+0x3a7c): undefined reference to `X509_free’
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_get_ssl_cipher’:
(.text+0x108a): undefined reference to `SSL_CIPHER_get_name’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `report_errors’:
(.text+0x45): undefined reference to `ERR_get_error_line_data’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0x8c): undefined reference to `SSL_new’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0x9a): undefined reference to `SSL_clear’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0xa2): undefined reference to `SSL_get_session’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0xae): undefined reference to `SSL_SESSION_set_timeout’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0xbc): undefined reference to `SSL_set_fd’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0xd1): undefined reference to `SSL_get_fd’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `ssl_do’:
(.text+0x14b): undefined reference to `SSL_free’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `sslconnect’:
(.text+0x16f): undefined reference to `SSL_connect’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `sslaccept’:
(.text+0x18f): undefined reference to `SSL_accept’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `vio_ssl_close’:
(.text+0x1c5): undefined reference to `SSL_set_quiet_shutdown’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `vio_ssl_close’:
(.text+0x1cd): undefined reference to `SSL_shutdown’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `vio_ssl_delete’:
(.text+0x212): undefined reference to `SSL_free’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `vio_ssl_write’:
(.text+0x261): undefined reference to `SSL_write’
/usr/lib/mysql/libmysqlclient.a(viossl.o): In function `vio_ssl_read’:
(.text+0x281): undefined reference to `SSL_read’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `report_errors’:
(.text+0x25): undefined reference to `ERR_get_error_line_data’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x99): undefined reference to `SSL_CTX_new’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0xbc): undefined reference to `SSL_CTX_set_cipher_list’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0xd9): undefined reference to `SSL_CTX_load_verify_locations’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0xfb): undefined reference to `SSL_CTX_use_certificate_file’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x125): undefined reference to `SSL_CTX_use_PrivateKey_file’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x135): undefined reference to `SSL_CTX_check_private_key’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x142): undefined reference to `DH_new’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x166): undefined reference to `BN_bin2bn’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x185): undefined reference to `BN_bin2bn’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1bb): undefined reference to `SSL_CTX_ctrl’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1c3): undefined reference to `DH_free’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1da): undefined reference to `SSL_load_error_strings’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1eb): undefined reference to `SSL_library_init’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1f0): undefined reference to `OPENSSL_add_all_algorithms_noconf’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x206): undefined reference to `SSL_CTX_set_default_verify_paths’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x21d): undefined reference to `SSL_CTX_free’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x2bd): undefined reference to `DH_free’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x2d6): undefined reference to `SSL_CTX_free’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0x328): undefined reference to `TLSv1_server_method’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0x36f): undefined reference to `SSL_CTX_ctrl’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0x389): undefined reference to `SSL_CTX_set_verify’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0x39f): undefined reference to `SSL_CTX_set_session_id_context’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLConnectorFd’:
(.text+0x3c6): undefined reference to `TLSv1_client_method’
/usr/lib/mysql/libmysqlclient.a(viosslfactories.o): In function `new_VioSSLConnectorFd’:
(.text+0x405): undefined reference to `SSL_CTX_set_verify’
/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_uncompress’:
(.text+0x60): undefined reference to `uncompress’
/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_compress_alloc’:
(.text+0x102): undefined reference to `compress’
collect2: ld returned 1 exit status
make: *** [nxstart] 오류 1

위의 오류는 ssl 관련 라이브러리를 찾지 못해서 발생되는 오류였다. 보통 SSL 라이브러리의 경우 MySQL 이 설치될때 같이 설치가 되는 것 같았는데 이번엔 조금 경우가 특이했다.

OS는 64비트 였지만 제품은 32 비트로 컴파일 해야 했던 것. 처음에는 약간 헤매었지만 결국 해결할 수 있었다.

OS:

Linux localhost.localdomain 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

SSL 라이브러리 설치:

# yum install openssl-devel.i386

SSL 라이브러리 추가:

-lssl

 

Tags: , , , ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.