我在Symbian上使用gSOAP和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我被难住了!在任何地方都找不到该文件。
发布于 2010-09-14 02:27:08
为了最终使其正常工作,我不得不移植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端口添加到.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 由于在塞班下,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-08 22:34:46
该头部由S60 SDK提供,位于:
%EPOCROOT%\epoc32\include\libc\netinet\tcp.h因此,为了正确解析#include <netinet\tcp.h>,您的MMP文件需要包含以下行:
SYSTEMINCLUDE /epoc32/include/libchttps://stackoverflow.com/questions/3668587
复制相似问题