Я пытаюсь скомпилировать свою первую программу C с библиотекой g SOAP, используя CodeBlocks на Windows 10.
Я уже создал все файлы с wsdl2h.exe и soapcpp2.exe и скопировал их в каталог моего проекта. Файлы были созданы с помощью стандартного файла typemap.dat с двумя некомментируемыми строками:
xsd__dateTime = #import "custom/struct_tm.h" | xsd__dateTime
xsd__date = #import "custom/struct_tm_date.h" | xsd__date
CodeBlocks компилирует его следующим образом:
gcc.exe -Wall -DWITH_N_C_LOCALE -g -c "C:\Users\username\Documents\code blocks\test\test\main.c" -o obj\Debug\main.o
gcc.exe -Wall -DWITH_N_C_LOCALE -g -c "C:\Users\username\Documents\code blocks\test\test\soapC.c" -o obj\Debug\soapC.o
gcc.exe -Wall -DWITH_N_C_LOCALE -g -c "C:\Users\username\Documents\code blocks\test\test\soapClient.c" -o obj\Debug\soapClient.o
gcc.exe -Wall -DWITH_N_C_LOCALE -g -c "C:\Users\username\Documents\code blocks\test\test\stdsoap2.c" -o obj\Debug\stdsoap2.o
gcc.exe -Wall -DWITH_N_C_LOCALE -g -c "C:\Users\username\Documents\code blocks\test\test\struct_tm.c" -o obj\Debug\struct_tm.o
gcc.exe -Wall -DWITH_N_C_LOCALE -g -c "C:\Users\username\Documents\code blocks\test\test\struct_tm_date.c" -o obj\Debug\struct_tm_date.o
gcc.exe -o bin\Debug\test.exe obj\Debug\main.o obj\Debug\soapC.o obj\Debug\soapClient.o obj\Debug\stdsoap2.o obj\Debug\struct_tm.o obj\Debug\struct_tm_date.o -lws2_32 "C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32\lib\libws2_32.a"
К сожалению, во время компиляции я получаю много ошибок, например :
C:\Users\username\Documents\code blocks\test\test\struct_tm.c:63:28: error: conflicting types for 'soap_default_xsd__dateTime'
SOAP_FMAC3 void SOAP_FMAC4 soap_default_xsd__dateTime(struct soap *soap, struct tm *a)
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\username\Documents\code blocks\test\test\struct_tm.c:60:
C:\Users\username\Documents\code blocks\test\test\soapH.h:6868:28: note: previous declaration of 'soap_default_xsd__dateTime' was here
SOAP_FMAC1 void SOAP_FMAC2 soap_default_xsd__dateTime(struct soap*, struct timeval *);
^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\username\Documents\code blocks\test\test\struct_tm.c:69:28: error: conflicting types for 'soap_serialize_xsd__dateTime'
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_xsd__dateTime(struct soap *soap, struct tm const *a)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\username\Documents\code blocks\test\test\struct_tm.c:60:
C:\Users\username\Documents\code blocks\test\test\soapH.h:6869:28: note: previous declaration of 'soap_serialize_xsd__dateTime' was here
SOAP_FMAC1 void SOAP_FMAC2 soap_serialize_xsd__dateTime(struct soap*, const struct timeval *);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\username\Documents\code blocks\test\test\struct_tm.c:74:36: error: conflicting types for 'soap_xsd__dateTime2s'
SOAP_FMAC3 const char * SOAP_FMAC4 soap_xsd__dateTime2s(struct soap *soap, const struct tm a)
^~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\username\Documents\code blocks\test\test\struct_tm.c:60:
C:\Users\username\Documents\code blocks\test\test\soapH.h:6870:37: note: previous declaration of 'soap_xsd__dateTime2s' was here
SOAP_FMAC3S const char* SOAP_FMAC4S soap_xsd__dateTime2s(struct soap*, struct timeval);
^~~~~~~~~~~~~~~~~~~~
C:\Users\username\Documents\code blocks\test\test\struct_tm.c:102:27: error: conflicting types for 'soap_out_xsd__dateTime'
SOAP_FMAC3 int SOAP_FMAC4 soap_out_xsd__dateTime(struct soap *soap, const char *tag, int id, const struct tm *a, const char *type)
^~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\username\Documents\code blocks\test\test\struct_tm.c:60:
C:\Users\username\Documents\code blocks\test\test\soapH.h:6871:27: note: previous declaration of 'soap_out_xsd__dateTime' was here
SOAP_FMAC1 int SOAP_FMAC2 soap_out_xsd__dateTime(struct soap*, const char*, int, const struct timeval *, const char*);
^~~~~~~~~~~~~~~~~~~~~~
C:\Users\username\Documents\code blocks\test\test\struct_tm.c:110:27: error: conflicting types for 'soap_s2xsd__dateTime'
SOAP_FMAC3 int SOAP_FMAC4 soap_s2xsd__dateTime(struct soap *soap, const char *s, struct tm *a)
^~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\username\Documents\code blocks\test\test\struct_tm.c:60:
C:\Users\username\Documents\code blocks\test\test\soapH.h:6872:29: note: previous declaration of 'soap_s2xsd__dateTime' was here
SOAP_FMAC3S int SOAP_FMAC4S soap_s2xsd__dateTime(struct soap*, const char*, struct timeval *);
^~~~~~~~~~~~~~~~~~~~
C:\Users\username\Documents\code blocks\test\test\struct_tm.c:225:35: error: conflicting types for 'soap_in_xsd__dateTime'
SOAP_FMAC3 struct tm * SOAP_FMAC4 soap_in_xsd__dateTime(struct soap *soap, const char *tag, struct tm *a, const char *type)
^~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\username\Documents\code blocks\test\test\struct_tm.c:60:
C:\Users\username\Documents\code blocks\test\test\soapH.h:6873:40: note: previous declaration of 'soap_in_xsd__dateTime' was here
SOAP_FMAC1 struct timeval * SOAP_FMAC2 soap_in_xsd__dateTime(struct soap*, const char*, struct timeval *, const char*);
^~~~~~~~~~~~~~~~~~~~~
Похоже, файлы, созданные wsdl2h.exe и soapcpp2.exe, дублируют функции, которые уже были определены в других файлах. Но почему?
Буду благодарен за любую помощь!