Hi @all,

I'm getting a strange error while compiling stdsoap2.cpp on linux with
 DEBUG defined. 
The same code compiles fine with Visual Studio.

The error seems to be that gsoap assumes to have the local versions of
the *printf* functions available while it is not true. 

A valid workaround is shown below. A cpp file which first includes
stdsoap2.h (which defines *printf*_l), than undefines the "wrong"
functions and at the end includes stdsoap2.cpp.

Is this a known bug in gsoap? Is the workaround I'm using the correct
way to get it work?

Thanks!



Error message:
stdsoap2.cpp: In function const char* soap_float2s(soap*, float):
stdsoap2.cpp:9515: error: sprintf_l was not declared in this scope
stdsoap2.cpp: In function int soap_s2float(soap*, const char*, float*):
stdsoap2.cpp:9565: warning: null argument where non-null required
(argument 3)
stdsoap2.cpp:9577: error: sscanf_l was not declared in this scope
stdsoap2.cpp: In function const char* soap_double2s(soap*, double):
stdsoap2.cpp:9659: error: sprintf_l was not declared in this scope
stdsoap2.cpp: In function int soap_s2double(soap*, const char*, double*):
stdsoap2.cpp:9704: warning: null argument where non-null required
(argument 3)
stdsoap2.cpp:9712: error: sscanf_l was not declared in this scope

Cpp file which includes stdsoap2.cpp to not get the error:
#ifdef LINUX
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Resources/include/gSOAP/stdsoap2.h"
#undef HAVE_SPRINTF_L
#undef HAVE_SSCANF_L
#undef HAVE_STRTOD_L
#endif // LINUX
#include "Resources/include/gSOAP/stdsoap2.cpp"
#ifdef LINUX
#pragma GCC diagnostic warning "-Wwrite-strings"
#endif // LINUX

Reply via email to