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.

4

2 回答 2

2

我有一个类似的问题,我解决了。尝试查看您是否使用了正确的库,我的意思是,如果您使用的是 x64 库并使用 32 位编译,那么它将出现相同的错误。快乐编码

于 2012-05-22T19:57:27.770 回答
0

我认为调试库是ssleay32MDd.liblibeay32MDd.lib(注意“d”后缀)。

于 2012-03-14T03:49:40.787 回答