3

I am new to Openssl, and trying to run a dhclient program available online at http://www.josuegomes.com/codeblog/dhclient.htm.

While doing so I get following errors,

dhclient.cpp
1>dhclient.obj : error LNK2019: unresolved external symbol _ERR_print_errors_fp referenced in function "void __cdecl handle_error(char const *,int,char const *)" (?handle_error@@YAXPBDH0@Z)
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_load_error_strings referenced in function "void __cdecl init_OpenSSL(void)" (?init_OpenSSL@@YAXXZ)
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_library_init referenced in function "void __cdecl init_OpenSSL(void)" (?init_OpenSSL@@YAXXZ)
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_CTX_set_cipher_list referenced in function "struct ssl_ctx_st * __cdecl setup_ctx(void)" (?setup_ctx@@YAPAUssl_ctx_st@@XZ)
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_CTX_new referenced in function "struct ssl_ctx_st * __cdecl setup_ctx(void)" (?setup_ctx@@YAPAUssl_ctx_st@@XZ)
1>dhclient.obj : error LNK2019: unresolved external symbol _TLSv1_client_method referenced in function "struct ssl_ctx_st * __cdecl setup_ctx(void)" (?setup_ctx@@YAPAUssl_ctx_st@@XZ)
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_CTX_free referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_free referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_shutdown referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_read referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_write referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_connect referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_set_bio referenced in function _main
1>dhclient.obj : error LNK2019: unresolved external symbol _SSL_new referenced in function _main 1>dhclient.obj : error LNK2019: unresolved external symbol _BIO_ctrl referenced in function _main 1>dhclient.obj : error LNK2019: unresolved external symbol _BIO_new_connect referenced in function _main 1>C:\Users\Rucha\Documents\Visual Studio 2010\Projects\emptyprojectssl\Debug\emptyprojectssl.exe : fatal error LNK1120: 16 unresolved externals

I have added includes and library paths, also my runtime library is MD and I have added ssleay32MD.lib libeay32MD.lib to external dependencies.

Please help.

Mooing Duck
  • 64,318
  • 19
  • 100
  • 158
rsule
  • 31
  • 1
  • 2
  • 1
    Did you ever figure this out? When compiling the OpenSSL libraries I had to make sure that they compiled with the right Visual Studio SDK and the right Platform. Then ensuring they are in the Linker->Input->Additional Dependencies. – CaptainBli Feb 14 '13 at 20:51

2 Answers2

2

I had a similar issue and i solved. Try to look if you are using the right libraries, i mean if you are using x64 lib and compiling with 32-bit then it will through the same error. Happy Coding

Pervez Alam
  • 1,246
  • 10
  • 20
0

I think the debug libs are ssleay32MDd.lib and libeay32MDd.lib (note the "d" suffix).

Fraser
  • 74,704
  • 20
  • 238
  • 215
  • Thanks Fraser, I tired playin with all possible combinations but m still getting the same errors! – rsule Mar 15 '12 at 22:41