无法编译使用 gSOAP 的 Qt Symbian 应用程序
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该标头由 S60 SDK 提供,位于此处:
为了正确解析
#include
,您的 MMP 文件需要包含以下行:This header is provided by the S60 SDK, and is located here:
In order to correctly resolve
#include <netinet\tcp.h>
therefore, your MMP file will need to contain the following line:为了最终使其工作,我必须将 gSOAP 移植为使用
stdapis
而不是libc
。我删除了
行之一,并使用
代替。您可以在 http://pastebin.com/xnrDbfFastdsoap2.h 文件一个>。
我还发现 Symbian 默认情况下不加载 STL,因此我所有返回
std::vector
和std::string
的方法现在都无法编译。我没有选择 -s 标志来禁用 STL 使用,而是将 Symbian STL 端口添加到
.pro
文件中的INCLUDEPATH
中,如下所示在
soapStub.h
中,我必须包含此外,您应该修改您的
typemap.dat
并添加以下内容以便能够编译。否则编译器会抱怨,
因为在 Symbian 下,gSOAP 是使用
WITH_LEAN
标志构建的,因此某些东西被禁用(例如,不支持time_t
序列化,并且不支持time_t
序列化)。支持LONG64
/ULONG64
序列化),因此所需的typemap.dat
会覆盖上面的内容。最后,为了将来参考,这里是我用来生成文件的命令行参数:
然后:
您可能还想在
typemap.dat
中设置命名空间并使用wsdl2h 重新生成
。To finally make it work, I had to port gSOAP to use
stdapis
instead oflibc
. 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
andstd::string
are now not compiling.Instead of opting to the
-s
flag to disable STL usage, I added the Symbian STL port to theINCLUDEPATH
in the.pro
file like soAnd in the
soapStub.h
I had to includeAlso you should modify your
typemap.dat
and add the following in order to be able to compile.Otherwise the compiler will complain about
since under Symbian, gSOAP is built with the
WITH_LEAN
flag, hence some of the stuff are disabled (for example, no support fortime_t
serialization and no support forLONG64
/ULONG64
serialization) hence the requiredtypemap.dat
overrides above.Finally, for future reference, here are the command line arguments that I used to generate the files:
And then:
You might also want to setup the namespaces in the
typemap.dat
and regenerate usingwsdl2h
.