网易博客旧文----gsoap例子的编译方法

news2024/10/7 11:30:40

gsoap例子的编译方法
2011-07-15 16:57:11| 分类: gSoap | 标签: |举报 |字号大中小 订阅

gsoap提供的例子在samples目录下,如果想编译的话,还得用点办法.
1、在linux下的编译方法
首先将gsoap解压后全部拷贝到linux的一个目录下,例如temp
注意切换到root用户

./configure --enable-samples
编译的情况见附1
这样每个例子就已经有makefile文件了
make
就会将gsoap编译成库,同时编译例子,但会碰到一个错误

g++ -DHAVE_CONFIG_H -I. -I…/…/… -I…/…/…/gsoap -I…/…/…/gsoap/plugin -DLINUX -DWITH_OPENSSL -DWITH_GZIP -DWSDL_IMPORT_PATH=“”/usr/local/share/gsoap/WS"" -g -O2 -MT autotest-soapC.o -MD -MP -MF .deps/autotest-soapC.Tpo -c -o autotest-soapC.o test -f 'soapC.cpp' || echo './'soapC.cpp
In file included from soapH.h:13,
from soapC.cpp:16:
soapStub.h:99: error: integer constant is too large for “long” type
soapStub.h:99: error: integer constant is too large for “long” type
soapStub.h:99: error: integer constant is too large for “long” type
soapStub.h:105: warning: this decimal constant is unsigned only in ISO C90
soapStub.h:105: warning: this decimal constant is unsigned only in ISO C90
make[5]: *** [autotest-soapC.o] 错误1

这个是例子autotest的编译错误,估计是其中定义的常数超过了long表示的范围,我的系统中long估计为4个字节
但没有关系,因为gsoap库已经生成,而且其他例子我们可以直接到具体的例子目录下编译,例如mtom-stream执行make即可

如果想在界面中调试,可以使用eclipse
以下以mtom例子为例说明步骤
新建一个c的工程

gsoap例子的编译方法 - xzhoumin - MMZHOU的博客

注意路径选mtom的即可,这样工程就直接建在这个目录下

gsoap例子的编译方法 - xzhoumin - MMZHOU的博客
将gsoap目录下的stdgsoap2.c,h拷贝到mtom目录下,若是c++的工程就用stdgsoap2.cpp
当然也可以用库的方式,但若是要单步调试到stdsoap2中,库就不行了,还是建议用源代码。
修改编译选项,在编译前调用soapcpp工具,用于生成需要的代理等文件
命令用:
…/…/…/…/gsoap/src/soapcpp2 -cL -d… -I…/…/…/…/gsoap/import:…/…/…/…/gsoap …/mtom-test.h
如下图,在工程属性中修改,-d…参数表示将文件输出到上级目录,因此当前目录是Debug或Release

gsoap例子的编译方法 - xzhoumin - MMZHOU的博客
编译即可生成需要的文件

2、在windows下的编译方法

以vc2008为例,新建一个控制台的工程
在例子mtom-stream目录下创建工程

gsoap例子的编译方法 - xzhoumin - MMZHOU的博客

将其他文件从工程中删除,加入mtom-stream-test.c,h到文件中
将mtom-stream-test.c的右键属性中修改不需要预编译头文件,如下图:

gsoap例子的编译方法 - xzhoumin - MMZHOU的博客

在mtom-stream-test.h的右键属性中,修改自定义生成步骤,如下图

gsoap例子的编译方法 - xzhoumin - MMZHOU的博客

命令行为:
…\gsoap\bin\win32\soapcpp2 -cL -d…/… -I…/…/…/…/…/gsoap/import;…/…/…/…/…/gsoap $(InputPath)
输出随便输点东西
编译第一次后,会生成一些文件
将.c文件都加入到工程中,
将stdsoap2.c,h加入到工程中,再次编译就完成了

附1:

./configure --enable-samples
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking whether make sets $(MAKE)… (cached) yes
checking for g++… g++
checking for C++ compiler default output file name… a.out
checking whether the C++ compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking for style of include used by make… GNU
checking dependency style of g++… gcc3
checking for gcc… gcc
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking dependency style of gcc… gcc3
checking whether gcc and cc understand -c and -o together… yes
checking for flex… flex
checking lex output file root… lex.yy
checking lex library… -lfl
checking whether yytext is a pointer… yes
checking for bison… bison -y
checking how to run the C preprocessor… gcc -E
checking for ranlib… ranlib
checking whether ln -s works… yes
checking for gawk… (cached) gawk
checking for a BSD-compatible install… /usr/bin/install -c
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking arpa/inet.h usability… yes
checking arpa/inet.h presence… yes
checking for arpa/inet.h… yes
checking xlocale.h usability… yes
checking xlocale.h presence… yes
checking for xlocale.h… yes
checking errno.h usability… yes
checking errno.h presence… yes
checking for errno.h… yes
checking fcntl.h usability… yes
checking fcntl.h presence… yes
checking for fcntl.h… yes
checking limits.h usability… yes
checking limits.h presence… yes
checking for limits.h… yes
checking netdb.h usability… yes
checking netdb.h presence… yes
checking for netdb.h… yes
checking netinet/in.h usability… yes
checking netinet/in.h presence… yes
checking for netinet/in.h… yes
checking for stdlib.h… (cached) yes
checking for string.h… (cached) yes
checking for strings.h… (cached) yes
checking for stdint.h… (cached) yes
checking sys/socket.h usability… yes
checking sys/socket.h presence… yes
checking for sys/socket.h… yes
checking for sys/types.h… (cached) yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking sys/timeb.h usability… yes
checking sys/timeb.h presence… yes
checking for sys/timeb.h… yes
checking for unistd.h… (cached) yes
checking poll.h usability… yes
checking poll.h presence… yes
checking for poll.h… yes
checking openssl/ssl.h usability… yes
checking openssl/ssl.h presence… yes
checking for openssl/ssl.h… yes
checking gnutls/gnutls.h usability… no
checking gnutls/gnutls.h presence… no
checking for gnutls/gnutls.h… no
checking zlib.h usability… yes
checking zlib.h presence… yes
checking for zlib.h… yes
checking for an ANSI C-conforming const… yes
checking for size_t… yes
checking whether time.h and sys/time.h may both be included… yes
checking whether struct tm is in sys/time.h or time.h… time.h
checking for sys/time.h… (cached) yes
checking for unistd.h… (cached) yes
checking for alarm… yes
checking for working mktime… no
checking return type of signal handlers… void
checking for strftime… yes
checking for random… yes
checking for gettimeofday… yes
checking for ftime… yes
checking for localtime_r… yes
checking for timegm… yes
checking for gmtime… yes
checking for gmtime_r… yes
checking for memset… yes
checking for select… yes
checking for socket… yes
checking for snprintf… yes
checking for strchr… yes
checking for strerror… yes
checking for strerror_r… yes
checking for strrchr… yes
checking for strstr… yes
checking for strtol… yes
checking for strtoul… yes
checking for strtoll… yes
checking for strtoull… yes
checking for strtold… yes
checking for strtod… yes
checking for strtof… yes
checking for strtold_l… yes
checking for strtod_l… yes
checking for strtof_l… yes
checking for sscanf… yes
checking for sscanf_l… no
checking for sprintf_l… no
checking for wctomb… yes
checking for mbtowc… yes
checking for poll… yes
checking for isnan… yes
checking for isinf… yes
checking for gethostbyname_r… yes
checking for stdlib.h… (cached) yes
checking for GNU libc compatible malloc… yes
checking for disable namespaces in library… no
checking for enable ipv6 in library… no
checking for disable openssl in library… no
checking for enable gnutls in library… no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gsoap.pc
config.status: creating gsoap++.pc
config.status: creating gsoapck.pc
config.status: creating gsoapck++.pc
config.status: creating gsoapssl.pc
config.status: creating gsoapssl++.pc
config.status: creating gsoap/Makefile
config.status: creating gsoap/src/Makefile
config.status: creating gsoap/wsdl/Makefile
config.status: creating gsoap/samples/Makefile
config.status: creating gsoap/samples/autotest/Makefile
config.status: creating gsoap/samples/calc/Makefile
config.status: creating gsoap/samples/calc++/Makefile
config.status: creating gsoap/samples/chaining++/Makefile
config.status: creating gsoap/samples/databinding/Makefile
config.status: creating gsoap/samples/dime/Makefile
config.status: creating gsoap/samples/dom/Makefile
config.status: creating gsoap/samples/oneway/Makefile
config.status: creating gsoap/samples/oneway++/Makefile
config.status: creating gsoap/samples/factory/Makefile
config.status: creating gsoap/samples/factorytest/Makefile
config.status: creating gsoap/samples/gmt/Makefile
config.status: creating gsoap/samples/googleapi/Makefile
config.status: creating gsoap/samples/hello/Makefile
config.status: creating gsoap/samples/httpcookies/Makefile
config.status: creating gsoap/samples/lu/Makefile
config.status: creating gsoap/samples/magic/Makefile
config.status: creating gsoap/samples/mashup/Makefile
config.status: creating gsoap/samples/mashup++/Makefile
config.status: creating gsoap/samples/mtom/Makefile
config.status: creating gsoap/samples/mtom-stream/Makefile
config.status: creating gsoap/samples/polytest/Makefile
config.status: creating gsoap/samples/primes/Makefile
config.status: creating gsoap/samples/roll/Makefile
config.status: creating gsoap/samples/router/Makefile
config.status: creating gsoap/samples/rss/Makefile
config.status: creating gsoap/samples/ssl/Makefile
config.status: creating gsoap/samples/template/Makefile
config.status: creating gsoap/samples/udp/Makefile
config.status: creating gsoap/samples/varparam/Makefile
config.status: creating gsoap/samples/wsa/Makefile
config.status: creating gsoap/samples/wsrm/Makefile
config.status: creating gsoap/samples/wsse/Makefile
config.status: creating gsoap/samples/xml-rpc-json/Makefile
config.status: creating config.h
config.status: executing depfiles commands

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2194061.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

上海理工大学《2023年+2019年867自动控制原理真题》 (完整版)

本文内容,全部选自自动化考研联盟的:《上海理工大学867自控考研资料》的真题篇。后续会持续更新更多学校,更多年份的真题,记得关注哦~ 目录 2023年真题 2019年真题 Part1:2023年2019年完整版真题 2023年真题 2019年…

Java使用线程池创建线程

一、线程前言 首先我们知道,线程的概念如果不知道可以去看这一篇Java中的线程,我们这篇主要讲述的是Java怎么使用线程池创建线程,首先我们要对线程池有点概念,其实顾名思义,线程池就是有喝多线程的一个池子类似于&…

一书讲透LLM大语言模型,《掌握大型语言模型》,看完我都懵了!

《掌握大型语言模型》 (Mastering Large Language Models)由Sanket Subhash Khandare撰写,是一本关于大型语言模型(LLMs)的高级技术、应用、前沿方法和顶尖模型的指南。 这本大模型书已经上传CSDN,朋友们如…

《Windows PE》4.2 绑定导入表

绑定导入表(Bound Import Table)是文件中的一个数据结构,用于存储已经绑定(即完成绑定导入)的外部函数的信息。 本节必须掌握的知识点: 绑定导入表数据结构 实例分析 4.2.1 绑定导入表数据结构 绑定导入…

【AIGC】ChatGPT是如何思考的:探索CoT思维链技术的奥秘

博客主页: [小ᶻZ࿆] 本文专栏: AIGC | ChatGPT 文章目录 💯前言💯什么是CoT思维链CoT思维链的背景与技术发展需求 💯CoT思维链的工作原理💯CoT思维链的应用领域💯CoT思维链的优势💯CoT思维…

动态内存管理笔试题

目录 1.第一题1.1如何修改 2.第二题2.1题想2.2深刻理解 3.第三题4.第四题 1.第一题 void GetMemory(char* p) {p (char*)malloc(100); } void Test(void) {char* str NULL;GetMemory(str);strcpy(str, "hello world");printf(str); }请问运⾏Test 函数会有什么样的…

解锁数字化营销成功密码

在趋势部分,列举了移动优先、社交媒体主导、个性化营销、视频营销崛起和数据驱动决策等方面,让读者快速了解数字化营销的发展方向。策略部分强调了明确目标受众、制定整合营销策略、优化用户体验、重视内容营销和社交媒体营销以及利用搜索引擎优化和数据…

jQuery——平滑翻页

平滑翻页 param next true:下一页 false:下一页 本文分享到此结束,欢迎大家评论区相互讨论学习,下一篇继续分享jQuery中循环翻页的学习。

Docker 实践与应用举例

Docker 实践与应用举例 Docker 已经成为现代软件开发和部署中的重要工具,通过容器化技术,开发者可以轻松管理应用的依赖环境、简化部署流程,并实现跨平台兼容性。本篇博客将详细介绍 Docker 的基本概念、实践操作以及应用场景,帮…

工业缺陷检测深度学习方法

工业缺陷检测深度学习方法 基于深度学习的工业缺陷检测方法可以降低传统人工质检的成本, 提升检测的准确性与效率, 因而在智能制造中扮演重要角色, 并逐渐成为计算机视觉领域新兴的研究热点之一. 其被广泛地应用 于无人质检、智能巡检、质量控制等各种生产与运维场景中. 本综述…

跨设备剪贴板同步服务ClipCascade

什么是 ClipCascade ? ClipCascade 是一款开源的轻量级工具,可以自动同步您的剪贴板在多个设备之间,无需按键。它确保设备之间无缝的剪贴板共享,并以端对端加密优先保护隐私。无论您是在不同工作站之间切换,还是仅仅希…

检索增强思考 RAT(RAG+COT):提升 AI 推理能力的强大组合

在人工智能领域,大型语言模型(LLMs)已经取得了显著的进展,能够生成类似人类的文本并回答各种问题。然而,它们在推理过程中仍面临一些挑战,例如缺乏对事实的准确把握以及难以处理复杂的多步骤问题。为了解决…

Unity3D 单例模式

Unity3D 泛型单例 单例模式 单例模式是一种创建型设计模式,能够保证一个类只有一个实例,提供访问实例的全局节点。 通常会把一些管理类设置成单例,例如 GameManager、UIManager 等,可以很方便地使用这些管理类单例,…

用YOLO和LLM增强的OCR

虽然最近我花了很多时间在大型语言模型 (LLM) 上进行实验,但我对计算机视觉的热情始终未减。因此,当我有机会将两者融合在一起时,我迫不及待地想要立即开始。在 Goodreads 上扫描书籍封面并将其标记为已读一直感觉有点神奇,我很兴…

SSM外卖点餐软件APP-计算机毕业设计源码30768

目 录 摘要 1 绪论 1.1 研究背景 1.2研究目的 1.3论文结构与章节安排 2 外卖点餐软件APP系统分析 2.1 可行性分析 2.1.1 技术可行性分析 2.1.2 经济可行性分析 2.1.3 操作可行性分析 2.2 系统流程分析 2.2.1 数据流程 3.3.2 业务流程 2.3 系统功能…

这些编程工具竟然能让我效率翻倍?开发者必备神器盘点!

人不走空 🌈个人主页:人不走空 💖系列专栏:算法专题 ⏰诗词歌赋:斯是陋室,惟吾德馨 目录 🌈个人主页:人不走空 💖系列专栏:算法专题 ⏰诗词歌…

基于深度学习多层感知机进行手机价格预测

数据集介绍 数据集采用了Kaggle实战数据集,链接如下,如有需要可自行下载 https://www.kaggle.com/datasets/atefehmirnaseri/cell-phone-price/data 数据集简要介绍 • battery_power:电池的总能量存储(毫安时) • blue:设备…

人工智能对未来工作影响的四种可能性

随着人工智能(AI)技术的迅速发展,其对人类工作的影响已成为讨论的热点话题。我们经常听到有关AI威胁论的观点,担心它将取代人类工作,但也有专家认为AI将成为一种辅助工具,帮助人类提升工作效率。宾夕法尼亚…

嵌入式硬件设计

嵌入式硬件设计是指针对嵌入式系统(一种专用的计算机系统,通常嵌入到其他设备中)进行的硬件设计工作。嵌入式系统广泛应用于消费电子、工业控制、医疗设备、汽车电子、航空航天等领域。以下是嵌入式硬件设计的主要内容和步骤: 1.…

括号匹配——(栈实现)

题目链接 有效的括号https://leetcode.cn/problems/valid-parentheses/description/ 题目要求 样例 解题代码 import java.util.*; class Solution {public boolean isValid(String str) {Stack<Character> stacknew Stack<>();for(int i0;i<str.length();i)…