最近我有一个使用gSOAP构建的小型C++ SOAP客户端项目(ubuntu linux)。我正在使用2个Web服务类,我相信我已根据文档正确创建了这些类。但是,我有我的代码gSOAP分段错误
#include "envH.h"
#include "betfairBFGlobalServiceProxy.h"
#include "betfairBFExchangeServiceProxy.h"
//#include "betfair.nsmap"
#include <iostream>
#include <string>
// Following included to prevent ligsoap++ complaining of undefined references
// to 'namespaces'
SOAP_NMAC struct Namespace namespaces[] = {};
using namespace std;
using namespace betfair;
int main()
{
BFGlobalServiceProxy bf;
BFExchangeServiceProxy betfair2; /* CRASH!! */
return 0;
}
我要让API调用两个Web服务,但在其中创建第二个服务代理对象点我的程序崩溃的问题。我使用wsdl2h -gbetfair选项和soapcpp2 -i -n选项创建了一个新的env.h文件,当使用C++命名空间创建多个客户端服务时,根据文档中的要求,在链接到libgsoap ++时避免链接器错误。任何人都可以看到我在做什么错?
我们很乐意提供帮助,但这很难理解。试着让你的问题更清楚一点。 – Shep 2012-04-20 21:34:59
简而言之,我有2个由gSOAP创建的客户端代理类 - 当我在创建第二个程序的时候实例化每个程序崩溃时,我不知道为什么。 – mathematician1975 2012-04-20 23:37:54