繁体   English   中英

编译gSOAP的-ONVIF解决#ERROR:“M_ASN1_STRING_data”在此范围内未声明

[英]Compile gsoap-onvif solve #error: ‘M_ASN1_STRING_data’ was not declared in this scope

我正在尝试在这里编译 gsoap-onvif 项目: https : //github.com/xris-hu/gsoap-onvif

我叫make文件,它抛出一些错误。 在 ubuntu 18.10 上工作,我解决了其中一些安装依赖项的问题:g++、gsoap、libssl-dev。 不幸的是,我有一个我无法理解的错误:

admin@UbuntuOS:~/Desktop/gsoap-onvif-master$ make
g++ -c -Wall -g -w -fPIC -DWITH_NONAMESPACES -fno-use-cxa-atexit -fexceptions -DWITH_DOM  -DWITH_OPENSSL -DSOAP_DEBUG   -I./include -I. stdsoap2.cpp -o stdsoap2.o
stdsoap2.cpp: In function ‘int tcp_connect(soap*, const char*, const char*, int)’:
stdsoap2.cpp:4406:52: error: ‘M_ASN1_STRING_data’ was not declared in this scope
             { if (!soap_tag_cmp(host, (const char*)M_ASN1_STRING_data(name)))
                                                    ^~~~~~~~~~~~~~~~~~
stdsoap2.cpp:4406:52: note: suggested alternative: ‘ASN1_STRING_data’
             { if (!soap_tag_cmp(host, (const char*)M_ASN1_STRING_data(name)))
                                                    ^~~~~~~~~~~~~~~~~~
                                                    ASN1_STRING_data
make: *** [Makefile:22: stdsoap2.o] Error 1

有人知道如何解决这个问题吗?

更新:这个项目中使用的 gSOAP 版本很旧,可能不适用于较新版本的 OpenSSL。 该项目可能已经死了......有人知道替代方案吗?

替代方案:这是我找到的最佳解决方案: https : //github.com/suresecure/onvifcpplib该库也用于https://sourceforge.net/projects/onvifmanager/

它接缝是一个OpenSSL的/ gSOAP的isseus,尝试用stdsoap2.cpp的新版本更新的软件。

https://github.com/Sufi-Al-Hussaini/onvif-gsoap-by-example/issues/1

在Python一个很好的解决方案是在GitHub以下项目:

https://github.com/FalkTannhaeuser/python-onvif-zeep

为Python 2.x的一种替代是:

https://github.com/quatanium/python-onvif

这里是一个补丁,我已经成功地使用,这是基于使用下面的源代码更新gSOAP的2.8版本:

#if OPENSSL_VERSION_NUMBER < 0x10100000L
              const char *tmp = (const char*)ASN1_STRING_data(name);
#else
              const char *tmp = (const char*)ASN1_STRING_get0_data(name);
#endif
              if (!soap_tag_cmp(host, tmp))
              {
                ok = 1;
                DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp));
              }

这个补丁的工作与旧版本的gSOAP的。

此编辑为在功能stdsoap2.c和stdsoap2.cpp取得tcp_connect()这是相当长的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM