Search code examples
cmacosgsoap

Linking error gsoap in mac in c


I try to add gsoap in my application. I built gsoap for i386. Created c code with under commands:

wsdl2h -c -s -o soap.h soap.wsdl 
soapcpp2 -c -C soap.h

I got files. After this I tried to include these to my app. I added to my project in xCode. Also I added 6 libraries(libgsoap.a,libgsoap++.a,libgsoapck.a, libgsoapck++.a, libgsoapssl.a, libgsoapssl++.a). I added libraries in Target => Build phases => Link binary with libraries. But I got error....

ld: duplicate symbol .....

I thought it happened cause in file soapClientLib.c was it:

#ifndef WITH_NOGLOBAL
#define WITH_NOGLOBAL
#endif
#define SOAP_FMAC3 static
#include "soapC.c"
#include "soapClient.c"

Comments for these was:

Use this file in your project build instead of the two files soapC.c and soapClient.c. This hides the serializer functions and avoids linking problems when linking multiple clients and servers

I removed it content. But after this I got next error...

Undefined symbols for architecture i386:
  "_namespaces", referenced from:
      _soap_init_LIBRARY_VERSION_REQUIRED_20812 in libgsoap.a(libgsoap_a-stdsoap2.o)
     (maybe you meant: _soap_set_namespaces, _soap_set_local_namespaces )
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And Now I have no idea... I used gsoap in windows and I added it to my project for 5 minutes. But I wasted much time to add it in mac os. Can you help me?


Solution

  • I resolved my problem! I had to do ./configure with keys --disable-namespaces. Thank you. But I steal don't understand sense of the file soapClientLib.c.