GSoap integration into Qt
-
Then why not setup a test project that everyone that is interested in can download and try to compile it. You can have a perfectly crafted .pro file and have some errors in the code nontheless. Or the setup needs to be adapted to your specific platform.
We may guess by a single line in the .pro snippet that you are working on windows. You did not bother to give us this information (you might consider this information marginal and not neccessary, I don't know).
But to get back to the problem: If you did not install it yourself, Windows does not have pkg-config, so lines 8 and 9 of the .pro have no function. You will have to add the libs to LIBS variable manually.
-
perhaps it's easy:
it says undefined reference, which means, you don't link against a lib that implements soap_new or you include a header that reference it but don use the cpp file.
Please check this.
-
Volker
Thank you :)
As you know, I am new and it completely slipped my mind that I should mention the platform as well (and I don't mind being told off for stuff like this). I have added a new line to my .pro file
@LIBS += C:\NokiaQtSDK\mingw\lib\libws2_32.a@
Still the error persists. I am going to look into the pkg-config thing. I have a feeling that the problem lies in there. Because I think the soap_* undefined problem stems from there.
-
And reading README and INSTALL text files of the libraries you use can also help:
[quote]README.txt:
To compile a client, all you need to do is to compile and link 'soapC.cpp', 'soapClient.cpp', and 'stdsoap2.cpp' (or the installed libgsoap++, see INSTALLATION below) with your code. [/quote]
[quote]INSTALL.txt:
You also need the following libraries (built from stdsoap2.c[pp]):
@
libgsoap++.a C++ runtime
libgsoapck++.a C++ runtime with HTTP cookie support
libgsoapssl++.a C++ runtime with cookies, zlib, and SSL
libgsoap.a C runtime
libgsoapck.a C runtime with HTTP cookie support
libgsoapssl.a C runtime with cookies, zlib, and SSL
@
Or you can use the stdsoap2.c and stdsoap2.cpp source directly, but you need to use the propoer -DWITH_X flags to enable support for 'X' (see above).
[/quote]EDIT:
To complete the things, you should add to your source list in the .pro:@
SOURCES += C:\gsoap-2.8\gsoap\stdsoap2.cpp
@And look for the WITH_XXX defines if you need SSL.
-
Please give us some more information:
- Platform (windows, which one)
- Compiler (mingw?)
- Qt version (4.7.2?)
The file you reference may be used by mingw, but not by MSVS. mingw and MSVS may not be mixed.
-
just interesting, had you a look at QtSoap? may it fit your needs?
-
To top off the comments: I doubt -QtSoap- gSoap will work properly without the network and XML modules of Qt. You might need to add those to your QT line in your .pro file.
-
Gerolf - I am using windows xp and mingw compiler but my original problem has now been resolved. Thank you for your help and time.
It is my understanding that QtSoap is a paid addition and that support for it is very negligible that is why I was sticking with gSoap.
Like Volker pointed out the problem was with the pkg_config addition in my original .pro file.
It was not working. Instead of that I added the stdsoap2.cpp to my sources. The project now compiles. Both methods work, you can either add it like volker did above or you can simply copy paste it into the app folder and then add it to your sources.
There is a lot of junk in my code due to all the hit and trial. I shall post the minimum requirements to run gSoap once I sort through all of this.
Please continue this discussion with other problems that you are facing or have faced in the past.
-
QtSoap is also released under GPL and part of "QtSolutions":http://qt.gitorious.org/qt-solutions
I'm currently using it on a project and it works fine for my needs.
Hope it is of any help. -
According to the "Qt Solutions Archive":http://qt.nokia.com/products/qt-addons/solutions-archive/ page at Nokia, the Qt SOAP solution has been "relicensed under the BSD license".
-
[quote author="awasay" date="1301400187"]Gerolf - I am using windows xp and mingw compiler but my original problem has now been resolved. Thank you for your help and time.
It is my understanding that QtSoap is a paid addition and that support for it is very negligible that is why I was sticking with gSoap.
Like Volker pointed out the problem was with the pkg_config addition in my original .pro file.
It was not working. Instead of that I added the stdsoap2.cpp to my sources. The project now compiles. Both methods work, you can either add it like volker did above or you can simply copy paste it into the app folder and then add it to your sources.
There is a lot of junk in my code due to all the hit and trial. I shall post the minimum requirements to run gSoap once I sort through all of this.
Please continue this discussion with other problems that you are facing or have faced in the past.[/quote]
I remember seeing this problem too and solved it by linking the library against binary I’m compiling properly. Maybe those scripts of mine helps about that.
Are you using CPP mode or C mode of it? You need link different library regarding which way you are using.
EDIT: And yeah, Google has been for me completely useless about gsoap, and their own documentation barely mentions CPP side of this... I basically read the files myself and that way forced it to work... C side works better but it’s very annoying to use.
And using QtSoap is viable alternative if it is enough good for one’s needs; for me it was not.