gpt4 book ai didi

c++ - 错误 LNK2019 : unresolved external symbol _soap_ssl_init

转载 作者:行者123 更新时间:2023-11-30 05:38:37 24 4
gpt4 key购买 nike

我正在使用 gsoap 调用 wcf 网络服务。我的要求是我必须使用 ssl 协议(protocol)来保护通信。我读了an article作为我的 ssl 配置引用。

但在编译时出现以下错误:

Error 1 error LNK2019: unresolved external symbol _soap_ssl_init referenced in function "public: int __thiscall LogServicesFacade::SendFileToServer(char const *)" (?SendFileToServer@LogServicesFacade@@QAEHPBD@Z) E:\Path\To\My\Solution.Project\LogServicesFacade.obj Solution.Project

这是我的代码:

_ns1__StoreEventFileResponse response;
_ns1__StoreEventFile input;
struct soap *soap = soap_new();

/*if (!sslInitiated)
{*/
soap_ssl_init();
//if (soap_ssl_client_context(soap, SOAP_SSL_DEFAULT, NULL, NULL,
//"C:\\Path\\To\\Certs\\File\\cacerts.pem", NULL, NULL))
//{
soap_print_fault(soap, stderr);
//}
//}

为了简单起见,我评论了一些其他 ssl 函数以减少错误。

更新 1

值得一提的是,我使用的是 VS 2013。因此我使用 Visual C++ 作为我的编译器。我也看到了 gSOAP ssl document .作者说我必须向编译器添加选项 DWITH_OPENSSL。如何将它添加到 VC 编译器中?

最佳答案

code project article说,我使用以下步骤减轻了错误:

  • Right click on the project and select Properties from the right click menu. Under Configuration Properties, C/C++ and General, add include paths to gSOAP and Open SSL. Click Apply.

  • Under Configuration Properties, C/C++ and Preprocessor, add “WITH_OPENSSL” (to enable SSL in gSOAP) and “DEBUG” (to enable logging) to the list of Preprocessor Definitions. Click Apply.

  • Under Configuration Properties, Linker and General, add the path to the Open SSL binary directory, where the compiled lib files reside, to Additional Library Directories. Click Apply.

  • Under Configuration Properties, Linker and Input, add “libeay32.lib” and “ssleay32.lib” to Additional Dependencies. These
    are the Open SSL libraries. Click Apply.

关于c++ - 错误 LNK2019 : unresolved external symbol _soap_ssl_init,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32645315/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com