首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

GSOAP C++移植和开发遇到的编译有关问题总结

2013-10-24 
GSOAP C++移植和开发遇到的编译问题总结1.cannot open file custom/duration.h for reading:解决办法:把

GSOAP C++移植和开发遇到的编译问题总结

1.cannot open file "custom/duration.h" for reading:

解决办法:
把gsoap2.8.15/gsoap/custom目录拷贝到当前工作目录


2.stdsoap2.cpp:8888: undefined reference to `namespaces
解决办法
make file:

CFLAGS := -g -O2 -Wall -Wno-deprecated-declarations -DWITH_NONAMESPACES

3.  undefined reference to `soap_default_xsd__duration
解决:

这个问题是因为在gSOAP工具中提供的typemap.dat文件中有下面的类型转换规则:

 

# Uncomment the line below to use LONG64 int for xsd:duration
# (with high ms precision)
# Must compile and link custom/duration.c with the project
xsd__duration = #import "custom/duration.h" | xsd__duration 而你在工程中没有加入和编译链接gsoap目录下的custon/duration.c文件。因此解决办法有两个:


(1)需要将\custom文件夹下面的duration.h和duration.c导入工程中。
这样还不行。由于使用C++编译器 因此需要将duration.c文件改为.cpp文件。
(2)修改你的typemap.dat文件中的上述转换规则,不使用LONG64,只使用long类型。

# Uncomment the line below to use LONG64 int for xsd:duration
# (with high ms precision)
# Must compile and link custom/duration.c with the project
#xsd__duration = #import "custom/duration.h" | xsd__duration

 

4.把通过wsdl生成的C++文件,编译成动态库。在其它C++程序中以动态库的形式,使用gsoap.出现编译错误:undefined reference to `namespaces
解决:编辑*.nsmap文件,把xx_namespaces去掉xx前缀,即修改为:namespaces

 

5.使用动态库出错: error while loading shared libraries...
解决办法: export LD_LIBRARY_PATH  = your lib dir

热点排行