我是靠谱客的博主 害羞猎豹,这篇文章主要介绍记录 ubuntu 20.04 下编译 gsoap 的过程及问题1 直接安装 `gSOAP`2 源代码编译 `gSOAP`,现在分享给大家,希望可以做个参考。
1 直接安装 `gSOAP`
如果不是跨平台或交叉编译的需要,直接使用命令安装即可,安装命令:
复制代码
1
2
3
4
5
6
7
8
9
10
11# 安装 ONVIF 框架编译工具(wsdl2h + soapcpp2) sudo apt install gsoap # 安装库文件(lib + 头文件) sudo apt install libgsoap-dev # 注意:直接安装的没有 stdsoap2.c 和 typemap.dat 文件, # 编译 ONVIF 框架时需要它们,需要去下载 gsoap 源代码。 # gsoap 工具: # wsdl2h:编译生成 onvif.h 框架头文件。 # soapcpp2:根据 onvif.h 生成 ONVIF 框架。
2 源代码编译 `gSOAP`
下面描述的是:在 ubuntu 20.04 平台上对 gsoap_2.8.91.tar.gz 进行编译。
2.1 源代码 `依赖`
复制代码
1
2
3
4(1) bison-3.0.2.tar.xz (2) flex-2.6.4.tar.gz (3) openssl-1.0.2h.tar.gz (4) gsoap_2.8.123.7z
2.2 编译 `bison`
复制代码
1
2
3
4
5
6
7
8
9
10
11# 编译命令: $ ./configure --prefix=/home/wangxl/onvif/install/bison # 编译错误: lib/fseterr.c:77:3: error: #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib." # 解决方法: 将 bison/lib/fseterr.c 的第 32 行修改为: #if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 # 修改完后再进行编译 !
2.3 编译 `flex`
复制代码
1
2
3# 编译命令: $ ./configure --prefix=/home/wangxl/onvif/install/flex
2.4 编译 `openssl`
复制代码
1
2
3
4
5# 编译命令: $ ./config --prefix=/home/wangxl/onvif/install/openssl $ make depend $ make -j5 $ make install
2.5 编译 `gsoap`
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16# 编译命令: $ ./configure --prefix=/home/wangxl/onvif/install/gsoap CPPFLAGS="-I /home/wangxl/onvif/install/flex/include" CFLAGS="-fPIC -Wl,-L /home/wangxl/onvif/install/flex/lib -lfl -L /home/wangxl/onvif/install/bison/lib -ly" --with-openssl="/home/wangxl/onvif/install/openssl" # 编译错误1: stdsoap2.h:1865:34: error: ‘malloc’ was not declared in this scope # 解决方法: 将 config.h 的第 280 行的 #define malloc rpl_malloc 屏蔽掉。 # 编译错误2: make[4]: *** 没有规则可制作目标“../gsoap/extras/*”,由“all-am” 需求。 停止。 # 解决方法: 将 makefile 的第 440 行的 $(top_srcdir)/gsoap/extra/* 删去。 # 编译错误3: make[4]: 进入目录“/home/wangxl/onvif/gsoap-2.8.91/gsoap/wsdl” dso_dlfcn.c:(.text+0x2a): undefined reference to “dlsym” # 解决方法: 将 gsoap/wsdl/makefile 中的 LIBS 加上 -ldl(即:LIBS=-ldl)
2.6 编译结果
至此,gsoap 编译完成!
最后
以上就是害羞猎豹最近收集整理的关于记录 ubuntu 20.04 下编译 gsoap 的过程及问题1 直接安装 `gSOAP`2 源代码编译 `gSOAP`的全部内容,更多相关记录内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复