1

我正在使用gSOAP和用于 Symbian 的 Qt。

在模拟器下,应用程序编译正常,但是当我将编译器的目标更改为为设备编译时,出现以下错误。

WARNING: Can't find following headers in System Include Path 
<netinet\tcp.h> 

这从stdsoap2.h文件中包含如下:

#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

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

4

2 回答 2

2

此标头由 S60 SDK 提供,位于此处:

%EPOCROOT%\epoc32\include\libc\netinet\tcp.h

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

SYSTEMINCLUDE /epoc32/include/libc
于 2010-09-08T14:34:45.857 回答
2

为了最终使它工作,我不得不移植 gSOAP 以使用stdapis而不是libc. 我删除了其中一条<netinet\tcp.h>线并<sys/select.h>改为使用。

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

我还发现 Symbian 默认不加载 STL,所以我所有的方法都返回std::vector并且std::string现在没有编译。

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

symbian {
    INCLUDEPATH += $$EPOCROOT\epoc32\include\stdapis\stlport
    INCLUDEPATH += $$EPOCROOT\epoc32\include\stdapis\stlport\stl
}

soapStub.h我必须包括

#include <vector>
#include <string>

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

# Symbian specific
xsd__dateTime = | std::string
xsd__long = | long
xsd__unsignedLong = | unsigned long
xsd__int = | int

否则编译器会抱怨

'soap_outdateTime' was not declared in this scope 
'soap_indateTime' was not declared in this scope 

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

最后,为了将来参考,这里是我用来生成文件的命令行参数:

wsdl2h.exe -o service.h http://myservicelocation.com/DataDisplayingWCF.svc?wsdl

进而:

soapcpp2.exe -I "C:\gsoap-2.7\gsoap\custom;C:\gsoap-2.7\gsoap\import" "service.h" -ixw

您可能还想在 中设置命名空间typemap.dat并使用 重新生成wsdl2h

于 2010-09-13T18:27:07.547 回答