我尝试在我的应用程序中添加 gsoap。 我为 i386 构建了 gsoap。 使用以下命令创建 C 代码:
wsdl2h -c -s -o soap.h soap.wsdl
soapcpp2 -c -C soap.h
我有文件。在此之后,我尝试将这些包含到我的应用程序中。 我在 xCode 中添加到我的项目中。我还添加了 6 个库(libgsoap.a、libgsoap++.a、libgsoapck.a、libgsoapck++.a、libgsoapssl.a、libgsoapssl++.a)。我在 Target => Build phases => Link binary with libraries 中添加了库。 但是我得到了错误....
ld: duplicate symbol .....
我认为它发生在文件 soapClientLib.c 中:
#ifndef WITH_NOGLOBAL
#define WITH_NOGLOBAL
#endif
#define SOAP_FMAC3 static
#include "soapC.c"
#include "soapClient.c"
对这些的评论是:
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
我删除了它的内容。 但是在此之后我遇到了下一个错误......
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)
现在我不知道... 我在 Windows 中使用 gsoap,并将它添加到我的项目中 5 分钟。但是我浪费了很多时间将它添加到 mac os 中。 你能帮帮我吗?
最佳答案
我解决了我的问题! 我必须使用 keys --disable-namespaces 执行 ./configure。 谢谢你。 但是我窃取了文件 soapClientLib.c 的意义。
关于c - 在c中的mac中链接错误gsoap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14118019/