gsoap调试笔记

 

代码来源:

 

gsoap使用心得

 

http://www.cppblog.com/qiujian5628/archive/2008/06/19/54019.aspx

 

 

出现的几个问题的解决:

 

问题1:

 

fatal error C1010: unexpected end of file while looking for precompiled header directive

 

 

解决: (http://www.china-askpro.com/msg24/qa08.shtml

     方法一:肯定是一个新添加的类的.cpp文件开头没包含stdafx.h,在该文件最前面加上即可。(这里是项目中新添加进来的借个文件)     
    方法二:有时可以使用右键点击项目工程中的该cpp文件,选择setting,在c/c++栏,选择PreCompiled headers,然后设置第一选项,选择不使用预编译头,解决这个问题。(还是这个方法好)

 

 

 

问题2:

 

error LNK2005: "int __cdecl soap_serve(struct soap *)" (?soap_serve@@$$FYAHPAUsoap@@@Z) already defined in soapServer.obj
 error LNK2005: "int __cdecl soap_serve(struct soap *)" (?soap_serve@@YAHPAUsoap@@@Z) already defined in soapServer.obj
error LNK2005: "int __cdecl soap_serve_ns__add(struct soap *)" (?soap_serve_ns__add@@$$FYAHPAUsoap@@@Z) already defined in soapServer.obj
error LNK2005: "int __cdecl soap_serve_ns__add(struct soap *)" (?soap_serve_ns__add@@YAHPAUsoap@@@Z) already defined in soapServer.obj
error LNK2005: "int __cdecl soap_serve_request(struct soap *)" (?soap_serve_request@@$$FYAHPAUsoap@@@Z) already defined in soapServer.obj
 error LNK2005: "int __cdecl soap_serve_request(struct soap *)" (?soap_serve_request@@YAHPAUsoap@@@Z) already defined in soapServer.obj
fatal error LNK1169: one or more multiply defined symbols found

 

 

解决:

把soapServerLib.cpp等文件也添加到了工程中,产生重复定义的错误。你用gsoap生成服务器端 客户端的文件后 并不是把生成的所有文件都拷到工程中,而只是拷贝你所需要的文件到工程目录里,

 

 

问题3:

 

error LNK2001: unresolved external symbol "int __cdecl ns__add(struct soap *,int,int,int *)" (?ns__add@@YAHPAUsoap@@HHPAH@Z)

 

解决:

这是在clinet编译的时候遇到的问题,做法是将server的整个工程文件夹复制成一个新的文件夹,将原来server 中main函数那个文件的代码,换成client代码,编译时候出来了这个问题

//分析发现是, add.h这个文件应该被从项目中移除。

//分析发现是, soapServer.cpp这个文件应该被从项目中移除。

 

 

 

 

gsoap使用心得

 

http://www.cppblog.com/qiujian5628/archive/2008/06/19/54019.aspx

内容复制到下面了:

 

 

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值