编译 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
这是我成功使用的一个补丁,它基于使用以下源代码的较新的 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 %sn", host, tmp));
}
此修补程序适用于较旧的 gSOAP 版本。
这个编辑是在函数tcp_connect()
中对stdsoap2.c和stdsoap2.cpp进行的,这是相当长的。
在Python中,一个非常好的解决方案是GitHub上的以下项目:
https://github.com/FalkTannhaeuser/python-onvif-zeep
Python 2.x的替代方案是:
https://github.com/quatanium/python-onvif。
这是 libssl1.0 库问题
转到此链接,从用户名saberprashant中找到答案,然后按照他的步骤进行操作。问题可能会得到解决。
- 错误:未在此范围内声明'reverse'
- 错误:"imread"未在此范围内声明
- 我在范围内未声明的错误类有问题
- 未在此范围内声明错误 'xy'
- Socklen_t未在此范围内声明
- 错误:'[' 之前预期的非限定 id 和错误:'users'未在此范围内声明
- "Main"已在当前范围内声明
- c++ 变量在宏的扩展中没有在这个范围内声明
- C++ 在编译过程中 strtok 函数 Eclipse 说没有在范围内声明?
- 'num1'未在此范围内声明
- 在此范围内未声明错误"Clreol"
- 如何找到在本地范围内声明的变量的地址?
- 简化在 Pybind11 中为 C++ 模板类生成包装类:模板声明不能出现在块范围内
- NT状态未在此范围内声明
- 变量未在此范围内声明 数组线性搜索
- 包含文件中的 Typdef "未在此范围内声明"
- 'ClassName'和'ClassInstance'未在此范围内声明
- "ChaCha"尚未在此范围内使用Crypto++声明?
- C++ 中的类之间的数据重新循环 - 错误:'<class name>'未在此范围内声明
- 如何在类声明范围内使用“using space::function”