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

发布于 2024-09-18 18:37:59 字数 1205 浏览 3 评论 0原文

我正在使用 gSOAP 以及 Qt for Symbian。

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

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

我被难住了!该文件无法在任何地方找到..

I'm using gSOAP along with Qt for Symbian.

Under the emulator, the application compiles fine, but when I change the target of the compiler to compile for the device, I get the following error.

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

This gets included from the stdsoap2.h file as follows:

#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

I'm stumped! The file cannot be found anywhere..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晚风撩人 2024-09-25 18:37:59

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

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

为了正确解析 #include,您的 MMP 文件需要包含以下行:

SYSTEMINCLUDE /epoc32/include/libc

This header is provided by the S60 SDK, and is located here:

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

In order to correctly resolve #include <netinet\tcp.h> therefore, your MMP file will need to contain the following line:

SYSTEMINCLUDE /epoc32/include/libc
阳光①夏 2024-09-25 18:37:59

为了最终使其工作,我必须将 gSOAP 移植为使用 stdapis 而不是 libc。我删除了 行之一,并使用 代替。

您可以在 http://pastebin.com/xnrDbfFastdsoap2.h 文件一个>。

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

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

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 序列化,并且不支持 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 重新生成

To finally make it work, I had to port gSOAP to use stdapis instead of libc. I removed one of the <netinet\tcp.h> lines and used <sys/select.h> instead.

You can find the ported stdsoap2.h file at http://pastebin.com/xnrDbfFa.

I also discovered that Symbian does not load STL by default, so all my methods that were returning std::vector and std::string are now not compiling.

Instead of opting to the -s flag to disable STL usage, I added the Symbian STL port to the INCLUDEPATH in the .pro file like so

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

And in the soapStub.h I had to include

#include <vector>
#include <string>

Also you should modify your typemap.dat and add the following in order to be able to compile.

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

Otherwise the compiler will complain about

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

since under Symbian, gSOAP is built with the WITH_LEAN flag, hence some of the stuff are disabled (for example, no support for time_t serialization and no support for LONG64/ULONG64 serialization) hence the required typemap.dat overrides above.

Finally, for future reference, here are the command line arguments that I used to generate the files:

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

And then:

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

You might also want to setup the namespaces in the typemap.dat and regenerate using wsdl2h.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文