c++ - #导入 : Cannot open file "soap12.h" for reading gSoap in VS 2010

标签 c++ visual-studio-2010 wsdl gsoap

我正在尝试将 gSoap2.8 与 VS2010 C++ 项目一起使用 我声明了一个预构建事件

wsdl2h.exe -o test.h "test.wsdl"

然后它说

error C1083: Cannot open type library file:<path>\stlvector.h: Error loading type library/DLL.  <path>\test.h

所以我使用 -s 来摆脱它,如下所示

wsdl2h.exe -s -o .\test.h "test.wsdl"

然后它说

error : #import: Cannot open file "soap12.h" for reading

我怎样才能摆脱这个?

最佳答案

“错误加载类型库/DLL”错误来自 Visual C++ 编译器。这可能是由您自己的文件中的如下 include 语句引起的:

#include test.h

为防止这种情况,只需省略该 include 语句即可。 wsdl2h 生成的 .h 文件仅供 soapcpp2 程序使用。它不应包含在您的项目中。

gSOAP 的 README.txt 文件中的以下声明支持此答案:

Do not include the wsdl2h-generated 'calc.h' header file directly into your code (the declarations are replicated in the generated code).

该语句引用的“calc.h”文件是示例文件,在您的情况下对应于“test.h”。

关于c++ - #导入 : Cannot open file "soap12.h" for reading gSoap in VS 2010,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20417852/

相关文章:

Python suds - 服务中未定义方法

c++ - boost 中有一个 DAG 图,没有顶点描述符失效

c++ - 从音频缓冲区和视频缓冲区 C++ Windows 构造 mp4 文件

c# - 监控线程创建

c# - Nuget 无法管理从 git 克隆的项目中的引用

java - 使用 ksoap2-android SOAP 客户端从 WSDL 生成 Java 以在 Android 上使用?

c++ - 通用 C++ 架构

C++:基于txt文件的幻方

c++ - 如何找到那些占用我内存的VC++代码?

java - 如何创建简单的 WSDL?