gSOAP cross-compiling in C++ for ws-discovery
Troubleshooting
Problem
arm-none-linux-gnueabi-g++ -DHAVE_CONFIG_H -I. -I../.. -I../../gsoap -I../../gsoap/plugin -DLINUX -Iyes/include -Iyes/include -DWITH_OPENSSL -DWITH_GZIP -DWSDL2H_IMPORT_PATH="\"/usr/share/gsoap /WS\"" -g -O2 -MT wsdl2h-service.o -MD -MP -MF .deps/wsdl2h-service.Tpo -c -o wsdl2h-service.o `test -f 'service.cpp' || echo './'`service.cpp
In file included from /opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/bits/stl_algo.h:60,
from /opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/algorithm:62,
from service.cpp:37:
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/cstdlib:119: error: '::malloc' has not been declared
make[5]: *** [wsdl2h-service.o] Error 1
Solution
Include #include <stdlib.h> first in gsoap/wsdl/service.cpp
Problem
arm-none-linux-gnueabi-g++ -Iyes/include -Iyes/include -DWITH_OPENSSL -DWITH_GZIP -DWSDL2H_IMPORT_PATH="\"/usr/share/gsoap/WS\"" -g -O2 -L../../gsoap/wsdl -I../../gsoap -I../../gsoap/plugin -o ws dl2h wsdl2h-wsdl2h.o wsdl2h-wsdl.o wsdl2h-wadl.o wsdl2h-schema.o wsdl2h-types.o wsdl2h-service.o wsdl2h-soap.o wsdl2h-mime.o wsdl2h-wsp.o wsdl2h-bpel.o wsdl2h-wsdlC.o wsdl2h-httpda.o wsdl2h-smdevp.o wsdl2h-threads.o ../../gsoap/libgsoapssl++.a -Lyes/lib -Lyes/lib -lssl -lcrypto -lz
wsdl2h-types.o: In function `emalloc(unsigned int)':
/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap/wsdl/types.cpp:4850: undefined reference to `rpl_malloc'
wsdl2h-httpda.o: In function `http_da':
/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap/wsdl/../../gsoap/plugin/httpda.c:535: undefined reference to `rpl_malloc'
wsdl2h-httpda.o: In function `http_da_session_start':
/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap/wsdl/../../gsoap/plugin/httpda.c:1339: undefined reference to `rpl_malloc'
wsdl2h-httpda.o: In function `http_da_copy':
/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap/wsdl/../../gsoap/plugin/httpda.c:587: undefined reference to `rpl_malloc'
wsdl2h-smdevp.o: In function `soap_smd_init':
/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap/wsdl/../../gsoap/plugin/smdevp.c:484: undefined reference to `rpl_malloc'
wsdl2h-smdevp.o:/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap/wsdl/../../gsoap/plugin/smdevp.c:494: more undefined references to `rpl_malloc' follow
Solution
Your config.h from the configure step probably has
/* Define to rpl_malloc if the replacement function should be used. */
#define malloc rpl_malloc
Just comment out that line, and recompile "make" or "make -j1"
Successfull Compilation!! Yayy!!
$ make TARGET_ARM7=1
mkdir -p gen
/home/flemieux/gsoap-2.8/gsoap/src/soapcpp2 -2Cx ../../gsoap-2.8/gsoap/import/wsdd10.h -I ../../gsoap-2.8/gsoap/import -d gen
** The gSOAP code generator for C and C++, soapcpp2 release 2.8.77
** Copyright (C) 2000-2019, Robert van Engelen, Genivia Inc.
** All Rights Reserved. This product is provided "as is", without any warranty.
** The soapcpp2 tool and its generated software are released under the GPL.
** ----------------------------------------------------------------------------
** A commercial use license is available from Genivia Inc., contact@genivia.com
** ----------------------------------------------------------------------------
Using project directory path: gen/
Saving gen/soapStub.h annotated copy of the source interface header file
Saving gen/soapH.h serialization functions to #include in projects
Using wsdd service name: wsdd
Using wsdd service style: document
Using wsdd service encoding: literal
Using wsdd schema import namespace: http://schemas.xmlsoap.org/ws/2005/04/discovery
Saving gen/wsdd.nsmap namespace mapping table
Saving gen/soapClient.cpp client call stub functions
Saving gen/soapClientLib.cpp client stubs with serializers (use only for libs)
Saving gen/soapC.cpp serialization functions
Compilation successful
arm-none-linux-gnueabi-g++ -DTARGET_ARM7 -I/home/flemieux/makito2_enc_2.2.1/components/include/ -L/home/flemieux/makito2_enc_2.2.1/build/OSCAR/output/libs -lmxsessmgr -lmxtools -lmxcfgfile -lcrypt -lhailogin -lmxclock -lmxfpga -lrt -g -o wsd-probe ../../gsoap-2.8/gsoap/plugin/wsddapi.c ../../gsoap-2.8/gsoap/plugin/wsaapi.c gen/soapC.cpp gen/soapClient.cpp probe.cpp -lgsoap++ -L/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap -I gen -I ../../gsoap-2.8/gsoap/plugin -I ../../gsoap-2.8/gsoap
arm-none-linux-gnueabi-g++ -DTARGET_ARM7 -I/home/flemieux/makito2_enc_2.2.1/components/include/ -L/home/flemieux/makito2_enc_2.2.1/build/OSCAR/output/libs -lmxsessmgr -lmxtools -lmxcfgfile -lcrypt -lhailogin -lmxclock -lmxfpga -lrt -g -o wsd-server ../../gsoap-2.8/gsoap/plugin/wsddapi.c ../../gsoap-2.8/gsoap/plugin/wsaapi.c gen/soapC.cpp gen/soapClient.cpp wsd-server.cpp server.cpp -lgsoap++ -L/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap -I gen -I ../../gsoap-2.8/gsoap/plugin -I ../../gsoap-2.8/gsoap
arm-none-linux-gnueabi-g++ -DTARGET_ARM7 -I/home/flemieux/makito2_enc_2.2.1/components/include/ -L/home/flemieux/makito2_enc_2.2.1/build/OSCAR/output/libs -lmxsessmgr -lmxtools -lmxcfgfile -lcrypt -lhailogin -lmxclock -lmxfpga -lrt -g -o wsd-proxy ../../gsoap-2.8/gsoap/plugin/wsddapi.c ../../gsoap-2.8/gsoap/plugin/wsaapi.c gen/soapC.cpp gen/soapClient.cpp proxy.cpp -lgsoap++ -L/home/flemieux/onvif/gsoap-2.8.77-arm/gsoap -I gen -I ../../gsoap-2.8/gsoap/plugin -I ../../gsoap-2.8/gsoap
$
Recent Comments