Build for Antennatracker with onvif fails

Hi, i am glad that the antennatracker received some updates ! I want to try to build it first on my local machine with onvif enabled to develop a onvif based tracking.

But i have some problems to build the antennatracker SITL with onvif enabled. Steps i did:

  • dev machine: Manjaro 6.4.16 / gcc version 13.2.1 20230801 (GCC)
  • install gsoap from modules folder (git submodule)
  • build using SITL: python3 sim_vehicle.py -v AntennaTracker --console --map --enable-onvif:
[ 455/1195] Compiling libraries/AP_ONVIF/AP_ONVIF.cpp
Dependency /home/USER/projects/SearchWing/ardupilot/ardupilot_test/libraries/AC_AttitudeControl/LogStructure.h for 
	{task 140639743177808: cxx AP_OpenDroneID.cpp -> AP_OpenDroneID.cpp.0.o} is missing: check the task declaration and the build order!
Dependency /home/USER/projects/SearchWing/ardupilot/ardupilot_test/libraries/AP_RCMapper/AP_RCMapper_config.h for 
	{task 140639743177808: cxx AP_OpenDroneID.cpp -> AP_OpenDroneID.cpp.0.o} is missing: check the task declaration and the build order!
Dependency /home/USER/projects/SearchWing/ardupilot/ardupilot_test/libraries/AP_CustomRotations/AP_CustomRotations_config.h for 
	{task 140639743177808: cxx AP_OpenDroneID.cpp -> AP_OpenDroneID.cpp.0.o} is missing: check the task declaration and the build order!
../../modules/gsoap/gsoap/dom.cpp: In function ‘int soap_out_xsd__anyType(soap*, const char*, int, const soap_dom_element*, const char*)’:
../../modules/gsoap/gsoap/dom.cpp:300:42: error: ‘%s’ directive output may be truncated writing up to 2046 bytes into a region of size between 1 and 2047 [-Werror=format-truncation=]
  300 |     (SOAP_SNPRINTF(s, l + 2, l + 1), "%s:%s", prefix, name);
      |                                          ^~
compilation terminated due to -Wfatal-errors.
cc1plus: some warnings being treated as errors

../../modules/gsoap/gsoap/custom/struct_timeval.cpp:63:28: error: no previous declaration for ‘void soap_default_xsd__dateTime(soap*, timeval*)’ [-Werror=missing-declarations]
   63 | SOAP_FMAC3 void SOAP_FMAC4 soap_default_xsd__dateTime(struct soap *soap, struct timeval *a)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: some warnings being treated as errors

In file included from ../../modules/gsoap/gsoap/plugin/wsseapi-lite.cpp:428:
../../modules/gsoap/gsoap/plugin/wsseapi-lite.h:92:67: error: use of enum ‘wsse__FaultcodeEnum’ without previous declaration
   92 | SOAP_FMAC1 int SOAP_FMAC2 soap_wsse_fault(struct soap *soap, enum wsse__FaultcodeEnum fault, const char *detail);
      |                                                                   ^~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_ONVIF/AP_ONVIF.h:28,
                 from ../../libraries/AP_ONVIF/AP_ONVIF.cpp:18:
../../modules/gsoap/gsoap/plugin/wsseapi-lite.h:92:67: error: use of enum ‘wsse__FaultcodeEnum’ without previous declaration
   92 | SOAP_FMAC1 int SOAP_FMAC2 soap_wsse_fault(struct soap *soap, enum wsse__FaultcodeEnum fault, const char *detail);
      |                                                                   ^~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

../../modules/gsoap/gsoap/stdsoap2.cpp: In function ‘void soap_set_fault(soap*)’:
../../modules/gsoap/gsoap/stdsoap2.cpp:22032:156: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size between 947 and 1970 [-Werror=format-truncation=]
22032 |     (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + strlen(soap->tag) + 47), "Validation constraint violation: %s%s in element '%s'", s, t, soap->tag);
      |                                                                                                                                                            ^~
compilation terminated due to -Wfatal-errors.
cc1plus: some warnings being treated as errors

Does anybody know why this happens?

  • OS mismatch?
  • wrong GCC ?
  • gsoap problem?

If i try to use the dev-base docker image, it also crashes:

../../modules/gsoap/gsoap/custom/struct_timeval.cpp:63:28: error: no previous declaration for ‘void soap_default_xsd__dateTime(soap*, timeval*)’ [-Werror=missing-declarations]
   63 | SOAP_FMAC3 void SOAP_FMAC4 soap_default_xsd__dateTime(struct soap *soap, struct timeval *a)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: some warnings being treated as errors

In file included from ../../modules/gsoap/gsoap/plugin/wsseapi-lite.cpp:428:
../../modules/gsoap/gsoap/plugin/wsseapi-lite.h:92:67: error: use of enum ‘wsse__FaultcodeEnum’ without previous declaration
   92 | SOAP_FMAC1 int SOAP_FMAC2 soap_wsse_fault(struct soap *soap, enum wsse__FaultcodeEnum fault, const char *detail);
      |                                                                   ^~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_ONVIF/AP_ONVIF.h:28,
                 from ../../libraries/AP_ONVIF/AP_ONVIF.cpp:18:
../../modules/gsoap/gsoap/plugin/wsseapi-lite.h:92:67: error: use of enum ‘wsse__FaultcodeEnum’ without previous declaration
   92 | SOAP_FMAC1 int SOAP_FMAC2 soap_wsse_fault(struct soap *soap, enum wsse__FaultcodeEnum fault, const char *detail);
      |                                                                   ^~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.



In file included from /usr/include/string.h:495,
                 from ../../libraries/AP_Common/missing/string.h:1,
                 from ../../modules/gsoap/gsoap/stdsoap2.h:660,
                 from ../../modules/gsoap/gsoap/stdsoap2.cpp:65:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘char* soap_string_in(soap*, int, long int, long int, const char*)’ at ../../modules/gsoap/gsoap/stdsoap2.cpp:15229:15:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../modules/gsoap/gsoap/stdsoap2.cpp: In function ‘char* soap_string_in(soap*, int, long int, long int, const char*)’:
../../modules/gsoap/gsoap/stdsoap2.cpp:15225:26: note: length computed here
15225 |         size_t k = strlen(tp->name);
      |                    ~~~~~~^~~~~~~~~~
In file included from /usr/include/string.h:495,
                 from ../../libraries/AP_Common/missing/string.h:1,
                 from ../../modules/gsoap/gsoap/stdsoap2.h:660,
                 from ../../modules/gsoap/gsoap/stdsoap2.cpp:65:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘wchar_t* soap_wstring_in(soap*, int, long int, long int, const char*)’ at ../../modules/gsoap/gsoap/stdsoap2.cpp:15974:15:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../modules/gsoap/gsoap/stdsoap2.cpp: In function ‘wchar_t* soap_wstring_in(soap*, int, long int, long int, const char*)’:
../../modules/gsoap/gsoap/stdsoap2.cpp:15970:26: note: length computed here
15970 |         size_t k = strlen(tp->name);
      |                    ~~~~~~^~~~~~~~~~
../../modules/gsoap/gsoap/stdsoap2.cpp: In function ‘void soap_set_fault(soap*)’:
../../modules/gsoap/gsoap/stdsoap2.cpp:22032:156: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size between 947 and 1970 [-Werror=format-truncation=]
22032 |     (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + strlen(soap->tag) + 47), "Validation constraint violation: %s%s in element '%s'", s, t, soap->tag);
      |                                                                                                                                                            ^~
compilation terminated due to -Wfatal-errors.
cc1plus: some warnings being treated as errors

Hi, thanks for the post. I hope that @peterbarker or @iampete might have some thoughts on this.

I’m not sure that Onvif is really supported though.

Thanks for your answer.

It seemed to have worked back in 2021: Add Support for ONVIF cam as part of Ardupilot in SITL/Linux by bugobliterator · Pull Request #17651 · ArduPilot/ardupilot · GitHub

Maybe @tridge knows, as he reviewed this.