簡體   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