gsoap返回结果是一个结构体编译报错

__Clown__ 2016-03-07 02:41:17
如下定义
//gsoap ns service name: struct
//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
//gsoap ns service namespace: http://localhost/struct.wsdl
//gsoap ns service location: http://localhost
//gsoap ns service executable: struct.cgi
//gsoap ns schema namespace: urn:struct

typedef struct JobStatusDetail {
int jobId;
int status;
char cpuTime[10];
char wallTime[10];
} testType;
typedef testType *xsd__JobStatusDetailPointer;

struct ns__JobStatusPointer {
xsd__JobStatusDetailPointer *__ptr;
int __size;
};

int ns__StructArrayTest(char *cmd, struct ns__JobStatusPointer *structResult);

编译的时候老是报如下错误,是什么问题

1>structServer.cpp
1>d:\gsoap\struct\soapstub.h(45) : error C2011: 'JobStatusDetail' : 'struct' type redefinition
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soapstub.h(77) : error C2011: 'ns__JobStatusPointer' : 'struct' type redefinition
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(543) : error C2027: use of undefined type 'ns__JobStatusPointer'
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(543) : error C2227: left of '->__ptr' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(544) : error C2027: use of undefined type 'ns__JobStatusPointer'
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(544) : error C2227: left of '->__size' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(637) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(637) : error C2227: left of '->jobId' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(638) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(638) : error C2227: left of '->status' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(639) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(639) : error C2227: left of '->cpuTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(640) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(640) : error C2227: left of '->wallTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(654) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(654) : error C2227: left of '->jobId' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(655) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(655) : error C2227: left of '->status' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(656) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(656) : error C2227: left of '->cpuTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(657) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(657) : error C2227: left of '->wallTime' must point to class/struct/union/generic type
1>Build log was saved at "file://d:\gSoap\struct\Server\Server\Debug\BuildLog.htm"
1>Server - 22 error(s), 0 warning(s)

...全文
235 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
cocoabird 2016-03-08
  • 打赏
  • 举报
回复
引用 4 楼 xiaopeng890903 的回复:
引用 3 楼 yuelengdihai 的回复:
[quote=引用 2 楼 xiaopeng890903 的回复:] [quote=引用 1 楼 yuelengdihai 的回复:] xsd__JobStatusDetailPointer *__ptr;??
主要是结构体重定义问题如何解决
这一行明显有错啊 [/quote] //gsoap ns service name: struct //gsoap ns service style: rpc //gsoap ns service encoding: encoded //gsoap ns service namespace: http://localhost/struct.wsdl //gsoap ns service location: http://localhost //gsoap ns service executable: struct.cgi //gsoap ns schema namespace: urn:struct struct Test { int userId; char *name; }; int ns__StructArrayTest(char *cmd, struct Test *structResult); 我写个简单的定义,然后编译,还是报这个错误,你看一下,这回有什么错误。编译结果如下: 1>------ Rebuild All started: Project: Server, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'Server', configuration 'Debug|Win32' 1>Compiling... 1>soapC.cpp 1>soapServer.cpp 1>stdsoap2.cpp 1>structServer.cpp 1>d:\gsoap\struct\soapstub.h(44) : error C2011: 'Test' : 'struct' type redefinition 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(533) : error C2027: use of undefined type 'Test' 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(533) : error C2227: left of '->userId' must point to class/struct/union/generic type 1>d:\gsoap\struct\soaph.h(545) : error C2027: use of undefined type 'Test' 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(545) : error C2227: left of '->userId' must point to class/struct/union/generic type 1>d:\gsoap\struct\soaph.h(546) : error C2027: use of undefined type 'Test' 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(546) : error C2227: left of '->name' must point to class/struct/union/generic type 1>Generating Code... 1>Build log was saved at "file://d:\gSoap\struct\Server\Server\Debug\BuildLog.htm" 1>Server - 7 error(s), 0 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========[/quote] typedef struct Test { int userId; char *name; }Test1; int ns__StructArrayTest(char *cmd, Test1 structResult);
__Clown__ 2016-03-07
  • 打赏
  • 举报
回复
引用 3 楼 yuelengdihai 的回复:
引用 2 楼 xiaopeng890903 的回复:
[quote=引用 1 楼 yuelengdihai 的回复:] xsd__JobStatusDetailPointer *__ptr;??
主要是结构体重定义问题如何解决
这一行明显有错啊 [/quote] //gsoap ns service name: struct //gsoap ns service style: rpc //gsoap ns service encoding: encoded //gsoap ns service namespace: http://localhost/struct.wsdl //gsoap ns service location: http://localhost //gsoap ns service executable: struct.cgi //gsoap ns schema namespace: urn:struct struct Test { int userId; char *name; }; int ns__StructArrayTest(char *cmd, struct Test *structResult); 我写个简单的定义,然后编译,还是报这个错误,你看一下,这回有什么错误。编译结果如下: 1>------ Rebuild All started: Project: Server, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'Server', configuration 'Debug|Win32' 1>Compiling... 1>soapC.cpp 1>soapServer.cpp 1>stdsoap2.cpp 1>structServer.cpp 1>d:\gsoap\struct\soapstub.h(44) : error C2011: 'Test' : 'struct' type redefinition 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(533) : error C2027: use of undefined type 'Test' 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(533) : error C2227: left of '->userId' must point to class/struct/union/generic type 1>d:\gsoap\struct\soaph.h(545) : error C2027: use of undefined type 'Test' 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(545) : error C2227: left of '->userId' must point to class/struct/union/generic type 1>d:\gsoap\struct\soaph.h(546) : error C2027: use of undefined type 'Test' 1> d:\gsoap\struct\struct.h(10) : see declaration of 'Test' 1>d:\gsoap\struct\soaph.h(546) : error C2227: left of '->name' must point to class/struct/union/generic type 1>Generating Code... 1>Build log was saved at "file://d:\gSoap\struct\Server\Server\Debug\BuildLog.htm" 1>Server - 7 error(s), 0 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
cocoabird 2016-03-07
  • 打赏
  • 举报
回复
引用 2 楼 xiaopeng890903 的回复:
引用 1 楼 yuelengdihai 的回复:
xsd__JobStatusDetailPointer *__ptr;??
主要是结构体重定义问题如何解决
这一行明显有错啊
__Clown__ 2016-03-07
  • 打赏
  • 举报
回复
引用 1 楼 yuelengdihai 的回复:
xsd__JobStatusDetailPointer *__ptr;??
主要是结构体重定义问题如何解决
cocoabird 2016-03-07
  • 打赏
  • 举报
回复
xsd__JobStatusDetailPointer *__ptr;??

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧