我创建了一个 Java Web 服务,并尝试从 gSOAP C 客户端访问此 Web 服务:
wsdl2h -c CalculatorService.wsdl
soapcpp2 -c -C CalculatorService.h
当我尝试用这个编译文件时:
g++ -o ClientWS.exe ClientWS.c soapC.c soapClient.c C:\gsoap-2.8.9\gsoap\stdsoap2.c -IC:\gsoap-2.8.9\gsoap -IC:\gsoap-2.8.9\gsoap\import -LC:\GNUstep\lib\libws2_32.a
我收到很多undefined reference
错误,如下所示:
C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0x188): undefined reference to
sendto@24' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0x1b2): undefined reference to
send@16' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0x280): undefined reference tosendto@24' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0x2aa): undefined reference to
send@16' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0x302): undefined reference tosend@16' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0x319): undefined reference to
WSAGetLastError@0' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0xad2): undefined reference torecvfrom@24' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0xaf6): undefined reference to
ntohl@4' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0xb29): undefined reference torecv@16' C:\DOCUME~1\MPERIY~1\LOCALS~1\Temp\ccvFm9ql.o:stdsoap2.c:(.text+0xb3e): undefined reference to
WSAGetLastError@0'
more errors like this...
collect2: ld returned 1 exit status
您能否提供有关如何链接丢失文件的解决方案?我不知道链接和包含路径是如何工作的,也不知道在哪里搜索 C 中的库。
我在 Windows 中有 GNUstep 和 gSOAP。