首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法编译使用gSOAP的Qt Symbian应用程序

无法编译使用gSOAP的Qt Symbian应用程序
EN

Stack Overflow用户
提问于 2010-09-08 22:10:46
回答 2查看 1.2K关注 0票数 1

我在Symbian上使用gSOAP和Qt。

在仿真器下,应用程序可以很好地编译,但当我将编译器的目标更改为针对设备进行编译时,我得到以下错误。

代码语言:javascript
复制
WARNING: Can't find following headers in System Include Path 
<netinet\tcp.h> 

这将包含在stdsoap2.h文件中,如下所示:

代码语言:javascript
复制
#ifndef WITH_NOIO
# ifndef WIN32
#  ifndef PALM
#   include <sys/socket.h>
#   ifdef VXWORKS
#    include <sockLib.h>
#    include <selectLib.h>
#    ifndef _WRS_KERNEL
#     include <strings.h>
#    endif
#   else
#    ifndef SYMBIAN
#     include <strings.h>
#    endif
#   endif
#   ifdef SUN_OS
#    include <sys/stream.h>     /* SUN */
#    include <sys/socketvar.h>      /* SUN < 2.8 (?) */
#   endif
#   ifdef VXWORKS
#    ifdef _WRS_KERNEL
#     include <sys/times.h>
#    endif
#   else
#    include <sys/time.h>
#   endif
#   include <netinet/in.h>
#   ifdef OS390
#    include <netinet/tcp_var.h>
#   else
#     include <netinet/tcp.h>          /* TCP_NODELAY */
#   endif
#   include <arpa/inet.h>
#  endif
# endif
#endif

我被难住了!在任何地方都找不到该文件。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-09-14 02:27:08

为了最终使其正常工作,我不得不移植gSOAP以使用stdapis而不是libc。我删除了其中一行<netinet\tcp.h>代码,转而使用<sys/select.h>

您可以在http://pastebin.com/xnrDbfFa上找到移植的stdsoap2.h文件。

我还发现Symbian在默认情况下并不加载STL,所以我所有返回std::vectorstd::string的方法现在都无法编译。

我没有选择使用-s标志来禁用STL,而是将Symbian STL端口添加到.pro文件中的INCLUDEPATH中,如下所示

代码语言:javascript
复制
symbian {
    INCLUDEPATH += $$EPOCROOT\epoc32\include\stdapis\stlport
    INCLUDEPATH += $$EPOCROOT\epoc32\include\stdapis\stlport\stl
}

soapStub.h中,我必须包含

代码语言:javascript
复制
#include <vector>
#include <string>

此外,您应该修改您的typemap.dat并添加以下内容,以便能够进行编译。

代码语言:javascript
复制
# Symbian specific
xsd__dateTime = | std::string
xsd__long = | long
xsd__unsignedLong = | unsigned long
xsd__int = | int

否则编译器将会报错

代码语言:javascript
复制
'soap_outdateTime' was not declared in this scope 
'soap_indateTime' was not declared in this scope 

由于在塞班下,gSOAP是用WITH_LEAN标志构建的,因此一些东西被禁用(例如,不支持time_t序列化和不支持LONG64/ULONG64序列化),因此需要覆盖上面的typemap.dat

最后,为了便于将来参考,下面是我用来生成文件的命令行参数:

代码语言:javascript
复制
wsdl2h.exe -o service.h http://myservicelocation.com/DataDisplayingWCF.svc?wsdl

然后:

代码语言:javascript
复制
soapcpp2.exe -I "C:\gsoap-2.7\gsoap\custom;C:\gsoap-2.7\gsoap\import" "service.h" -ixw

您可能还希望在typemap.dat中设置名称空间并使用wsdl2h重新生成。

票数 2
EN

Stack Overflow用户

发布于 2010-09-08 22:34:46

该头部由S60 SDK提供,位于:

代码语言:javascript
复制
%EPOCROOT%\epoc32\include\libc\netinet\tcp.h

因此,为了正确解析#include <netinet\tcp.h>,您的MMP文件需要包含以下行:

代码语言:javascript
复制
SYSTEMINCLUDE /epoc32/include/libc
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3668587

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档