加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

编写gSoap XML/RPC程序时出现“soapStub.h: error: redefinition

发布时间:2020-12-16 08:19:17 所属栏目:百科 来源:网络整理
导读:最近使用gSOAP XML/RPC + C代码编写我的测试程序,编译时出现“soapStub.h: error: redefinition of parameter ‘soap’”。 [root@localhost src]# make iclient gcc -o iclient iclient .c wsi2c.h soapClient.c soapC.c base.c base.h -lgsoap In file in

最近使用gSOAP XML/RPC + C代码编写我的测试程序,编译时出现“soapStub.h: error: redefinition of parameter ‘soap’”。

[root@localhost src]# make iclient
gcc -o iclient iclient.c wsi2c.h soapClient.c soapC.c base.c base.h -lgsoap
In file included from soapH.h:13:0,
from iclient.c:12:
soapStub.h:255:132: error: redefinition of parameter ‘soap’
SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns__myset(struct soap *soap,const char *soap_endpoint,const char *soap_action,struct soap *soap,char *bus,char *devaddr,int reg,int data,int *result);

根据提示,soap_call_ns__myset(struct soap *soap,int *result),注意到了soap_call_ns__myset函数的参数出现了两个struct soap*soap,因此报此错。

解决方法是将iws.h文件直接删除struct soap *soap即可。

int ns__myset(struct soap *soap,char *bus,int *result);


如果服务器端需要使用struct soap *soap结构体指针,那就在服务器端程序中添加即可。例如:

1、iws.h

int ns__myset(char *bus,int *result);

2、iserver.c

int ns__myset(struct soap *soap,char *bus,int *result);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读