Search code examples
c++web-serviceswcfgsoap

error: 'memcpy_s' was not declared in this scope in gSOAP


I need to implement a client proxy for wcf web service using gSOAP in c++. I used Getting Started page (in section "Example gSOAP client (C++)") for generating client proxy to test my web service. When I want to build project using

c++ -o calcclient calcclient.cpp soapC.cpp soapcalcProxy.cpp stdsoap2.cpp

command I get following errors:

enter image description here

It seems there are some standard library that does not included in stdsoap2.cpp. I use MinGW as compiler and my OS is Windows 8.


Solution

  • memcpy_s is a safe version of memcpy and normally included with standard libraries. MSVC does it, MinGW64 too.

    With Code::Blocks you get TDM GCC which is behind MinGW64 and seems not to have the secure API. Just load MinGW64, configure Code::Blocks to use this compiler and all should be fine.