Discussion:
Newbie problem compiling gsoap
Claudia Neumann
2010-06-20 10:44:36 UTC
Permalink
Hi all!

My system: Linux Debian Lenny, kernel 2.6.26, gcc 4.1.3, g++ 4.3.4

gsoap (2.7.17, downloaded from Sourceforge) doesn't compile all samples. It
hangs with:
make[6]: Entering directory `/usr/src/gsoap-2.7/gsoap/samples/factorytest'
g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../gsoap -I../../../gsoap/plugin -DLINUX -g -O2 -MT
factorytest.o -MD -MP -MF .deps/factorytest.Tpo -c -o factorytest.o
factorytest.cpp
factorytest.cpp:52:22: error: iostream.h: Datei oder Verzeichnis nicht
gefunden
factorytest.cpp: In function ‘int main(int, char**)’:
factorytest.cpp:170: error: ‘cout’ was not declared in this scope
factorytest.cpp:170: error: ‘endl’ was not declared in this scope

I suppose cout and endl have to be declared. But I don't know how to do this
in C++.

Next I wanted to follow the example in
1.2 Quick Start: Developing a Web Service Client Application
and tried to compile calcclient with C.

***@Compac-deb:~/soap$ cc -o calcclient.c soapC.c soapClient.c -lgsoap
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function
`_start':
(.text+0x18): undefined reference to `main'
/usr/local/lib/libgsoap.a(libgsoap_a-stdsoap2.o): In function `soap_init':
/usr/src/gsoap-2.7/gsoap/stdsoap2.c:8053: undefined reference to `namespaces'
collect2: ld returned 1 exit status

What namespaces do I have to use and where should I change it?

Best regards

Claudia



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/gsoap/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/gsoap/join
(Yahoo! ID required)

<*> To change settings via email:
gsoap-digest-***@public.gmane.org
gsoap-fullfeatured-***@public.gmane.org

<*> To unsubscribe from this group, send an email to:
gsoap-unsubscribe-***@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Sebastian Unger
2010-06-20 11:22:01 UTC
Permalink
Hi Claudia,
Post by Claudia Neumann
gsoap (2.7.17, downloaded from Sourceforge) doesn't compile all samples. It
make[6]: Entering directory `/usr/src/gsoap-2.7/gsoap/samples/factorytest'
g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../gsoap -I../../../gsoap/plugin
-DLINUX -g -O2 -MT factorytest.o -MD -MP -MF .deps/factorytest.Tpo -c -o
factorytest.o factorytest.cpp
factorytest.cpp:52:22: error: iostream.h: Datei oder Verzeichnis nicht
I'm not quite sure, but shouldn't it be iostream, not iostream.h? Maybe, it
helps altering that row in the source code (one of the includes).
Post by Claudia Neumann
gefunden
factorytest.cpp:170: error: ‘cout’ was not declared in this scope
factorytest.cpp:170: error: ‘endl’ was not declared in this scope
I suppose cout and endl have to be declared. But I don't know how to do
this in C++.
Try adding the row

using namespace std;

below the include-statements.
Post by Claudia Neumann
Next I wanted to follow the example in
1.2 Quick Start: Developing a Web Service Client Application
and tried to compile calcclient with C.
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function
(.text+0x18): undefined reference to `main'
/usr/src/gsoap-2.7/gsoap/stdsoap2.c:8053: undefined reference to
`namespaces' collect2: ld returned 1 exit status
On a first glance, I'd guess it's the syntax of invoking cc. The option -o
defines the name of the output file. Try sth. like

cc -o MyCalcClient calcclient.c soapC.c soapClient.c -lgsoap

instead.

Regards,

Sebastian
Claudia Neumann
2010-06-20 12:13:27 UTC
Permalink
Hi Sebastian,
Post by Sebastian Unger
Hi Claudia,
Post by Claudia Neumann
gsoap (2.7.17, downloaded from Sourceforge) doesn't compile all samples.
make[6]: Entering directory
`/usr/src/gsoap-2.7/gsoap/samples/factorytest' g++ -DHAVE_CONFIG_H -I.
-I../../.. -I../../../gsoap -I../../../gsoap/plugin -DLINUX -g -O2 -MT
factorytest.o -MD -MP -MF .deps/factorytest.Tpo -c -o factorytest.o
factorytest.cpp
factorytest.cpp:52:22: error: iostream.h: Datei oder Verzeichnis nicht
I'm not quite sure, but shouldn't it be iostream, not iostream.h? Maybe, it
helps altering that row in the source code (one of the includes).
Post by Claudia Neumann
gefunden
factorytest.cpp:170: error: ‘cout’ was not declared in this scope
factorytest.cpp:170: error: ‘endl’ was not declared in this scope
I suppose cout and endl have to be declared. But I don't know how to do
this in C++.
Try adding the row
using namespace std;
below the include-statements.
Changed factorytest.cpp line 52:
#include <iostream>
using namespace std;

Then factorytest compiled.

Same problem with sample/lu:
make[6]: Entering directory `/usr/src/gsoap-2.7/gsoap/samples/lu'
g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../gsoap -I../../../gsoap/plugin -DLINUX -g -O2 -MT
luclient.o -MD -MP -MF .deps/luclient.Tpo -c -o luclient.o luclient.cpp
luclient.cpp:35:22: error: iostream.h: Datei oder Verzeichnis nicht gefunden
luclient.cpp: In function ‘int main(int, char**)’:
luclient.cpp:54: error: ‘cout’ was not declared in this scope
luclient.cpp:54: error: ‘endl’ was not declared in this scope

Changed as above. Now all examples compiled okay.
Post by Sebastian Unger
Post by Claudia Neumann
Next I wanted to follow the example in
1.2 Quick Start: Developing a Web Service Client Application
and tried to compile calcclient with C.
-lgsoap /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In
(.text+0x18): undefined reference to `main'
/usr/local/lib/libgsoap.a(libgsoap_a-stdsoap2.o): In function
`soap_init': /usr/src/gsoap-2.7/gsoap/stdsoap2.c:8053: undefined
reference to `namespaces' collect2: ld returned 1 exit status
On a first glance, I'd guess it's the syntax of invoking cc. The option -o
defines the name of the output file. Try sth. like
cc -o MyCalcClient calcclient.c soapC.c soapClient.c -lgsoap
Sorry, error in commandline:
gcc -o client soapC.c soapClient.c -lgsoap
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function
`_start':
(.text+0x18): undefined reference to `main'
/usr/local/lib/libgsoap.a(libgsoap_a-stdsoap2.o): In function `soap_init':
/usr/src/gsoap-2.7/gsoap/stdsoap2.c:8053: undefined reference to `namespaces'
collect2: ld returned 1 exit status

The -o param should be the output file. There is a soapClientLib.c in the
directory as well. But trying to compile it in give other errors.

What do I need else? I don't understand the QuickStart introduction.

Best regards

Claudia Neumann



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/gsoap/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/gsoap/join
(Yahoo! ID required)

<*> To change settings via email:
gsoap-digest-***@public.gmane.org
gsoap-fullfeatured-***@public.gmane.org

<*> To unsubscribe from this group, send an email to:
gsoap-unsubscribe-***@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Sebastian Unger
2010-06-20 12:25:36 UTC
Permalink
Hi Claudia,
Post by Claudia Neumann
Changed as above. Now all examples compiled okay.
fine.
Post by Claudia Neumann
Post by Sebastian Unger
Post by Claudia Neumann
Next I wanted to follow the example in
1.2 Quick Start: Developing a Web Service Client Application
and tried to compile calcclient with C.
-lgsoap /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In
(.text+0x18): undefined reference to `main'
/usr/local/lib/libgsoap.a(libgsoap_a-stdsoap2.o): In function
`soap_init': /usr/src/gsoap-2.7/gsoap/stdsoap2.c:8053: undefined
reference to `namespaces' collect2: ld returned 1 exit status
On a first glance, I'd guess it's the syntax of invoking cc. The option
-o defines the name of the output file. Try sth. like
cc -o MyCalcClient calcclient.c soapC.c soapClient.c -lgsoap
gcc -o client soapC.c soapClient.c -lgsoap
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function
(.text+0x18): undefined reference to `main'
/usr/src/gsoap-2.7/gsoap/stdsoap2.c:8053: undefined reference to
`namespaces' collect2: ld returned 1 exit status
The -o param should be the output file. There is a soapClientLib.c in the
directory as well. But trying to compile it in give other errors.
What do I need else? I don't understand the QuickStart introduction.
Well, now there's certainly missing the main-file (the one that contains the
main()-function).

Cpt 1.2 shows two sample codes. The first is C++ Code, the second one is C-
Code. I assume, you have saved the second one in calcclient.c. Now

gcc -o client calcclient.c soapC.c soapClient.c -lgsoap

should do the trick.

Regards,

Sebastian
Claudia Neumann
2010-06-20 15:24:20 UTC
Permalink
Hi Sebastian,
Post by Sebastian Unger
Well, now there's certainly missing the main-file (the one that contains
the main()-function).
Cpt 1.2 shows two sample codes. The first is C++ Code, the second one is C-
Code. I assume, you have saved the second one in calcclient.c. Now
gcc -o client calcclient.c soapC.c soapClient.c -lgsoap
should do the trick.
Excuse me for being stubborn ;-).

calcclient.c:
#include "soapH.h"
#include "calc.nsmap"
main()
{
struct soap *soap = soap_new();
double result;
if (soap_call_ns__add(soap, 1.0, 2.0, &result) == SOAP_OK)
printf("The sum of 1.0 and 2.0 is %lg\n", result);
else
soap_print_fault(soap, stderr);
soap_end(soap);
soap_free(soap);
}

gcc -o client calcclient.c soapC.c soapClient.c -lgsoap
/tmp/cc8e8vLD.o: In function `main':
calcclient.c:(.text+0x37): undefined reference to `soap_call_ns__add'
collect2: ld returned 1 exit status

changed soap_call_ns__add to soap_call_ns2__add:
gcc -o client calcclient.c soapC.c soapClient.c -lgsoap
calcclient.c: In function ‘main’:
calcclient.c:7: error: incompatible type for argument 2
of ‘soap_call_ns2__add’
calcclient.c:7: error: incompatible type for argument 3
of ‘soap_call_ns2__add’
calcclient.c:7: error: incompatible type for argument 4
of ‘soap_call_ns2__add’
calcclient.c:7: error: too few arguments to function ‘soap_call_ns2__add’

What now?

Viele Grüße

Claudia



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/gsoap/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/gsoap/join
(Yahoo! ID required)

<*> To change settings via email:
gsoap-digest-***@public.gmane.org
gsoap-fullfeatured-***@public.gmane.org

<*> To unsubscribe from this group, send an email to:
gsoap-unsubscribe-***@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Loading...