在Qt/Windows中使用gSoap [英] Using gSoap in Qt/Windows

查看:256
本文介绍了在Qt/Windows中使用gSoap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了gSoap页面上的步骤,并尝试运行使用Mingw32编译器的Qt/Windows中的示例代码.但是,如文档中所述,我无法将lgsoap ++添加到链接器中,因为它不在

I followed the steps on gSoap's page and tried to run the example code in Qt/Windows with Mingw32 Compiler. However, I can't add lgsoap++ to linker, as stated in the documentation, since it is not in the source package

要完成构建,请编译并 链接生成的soapC.cpp, soapcalcProxy.cpp,以及运行时 gSOAP引擎-lgsoap ++(或使用源代码) 如果libgsoap ++.a是stdsoap2.cpp 未安装).

To complete the build, compile and link the generated soapC.cpp, soapcalcProxy.cpp, and the run-time gSOAP engine -lgsoap++ (or use source stdsoap2.cpp in case libgsoap++.a is not installed) with your code.

然后,我尝试将stdsoap2.cpp添加到SOURCES中,结果是这是编译输出.所以我的问题是如何使用Mingw32编译器在Qt中运行此示例代码片段,或者如何生成该lgsoap ++.以下是我的专业版和源文件:

Then I tried adding stdsoap2.cpp to SOURCES and this is the compile output as a result. So my question is how I will run this example code snippet in Qt with Mingw32 compiler or how I will generate that lgsoap++. Followings are my pro and source files:

QT -= gui
TARGET = SoapCalc
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp \
    ../Console/gsoap/stdsoap2.cpp
OTHER_FILES += ../../../../../gsoap/gsoap-2.7/gsoap/calc.nsmap
HEADERS += ../../../../../gsoap/gsoap-2.7/gsoap/soapcalcProxy.h


#include"C:/gsoap/gsoap-2.7/gsoap/soapcalcProxy.h"
#include"C:/gsoap/gsoap-2.7/gsoap/calc.nsmap"


int main(int argc, char *argv[])
{
    calcProxy service;
    return 0;
}

推荐答案

最后,我已经解决了. 遵循gSoap页面上的指南.将以下文件添加到您的项目中:生成的* .cpp,*.h,*.nsmap,服务定义文件-您在命令行上键入的名称,例如指南中的calc.h-下载的zip文件的gsoap目录中的stdsoap2.h/cpp文件.包含代理文件后-e.g. soapcalcProxy.h-和* .nsmap到您的主文件,还有一件事 我以前忘记了:

Finally, I have resolved it. Follow the guidelines on the gSoap's page. Add the following files to your project: generated *.cpp, *.h, *.nsmap, service definition file - the name of which you type on command line e.g. calc.h in the guideline - and stdsoap2.h/cpp files in the gsoap directory of the downloaded zip file. After including proxy file -e.g. soapcalcProxy.h - and *.nsmap to your main file there remains one thing that I forgot to realize before:

LIBS + = C:\ MinGW \ lib \ libws2_32.a 添加到* .pro文件中. libws32_a是已弃用的libwsock32.a文件的当前版本.

add LIBS += C:\MinGW\lib\libws2_32.a to your *.pro file. libws32_a is the current version of the deprecated libwsock32.a file.

这篇关于在Qt/Windows中使用gSoap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆