我正在尝试将 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/