I have RHEL with GCC 4.1.2 and my C++ code is compiling as expected. But same code when I try to compile on CentOS 7.2 with GCC 6.2.0 it fails with below error:
compiling UpcSummarization.o ...
UpcSummarization.cpp: In member function âvoid UpcSummarization::LoadUpcList(std::__cxx11::string)â:
UpcSummarization.cpp:480:40: error: âmemsetâ was not declared in this scope
memset(&pBuffer, 0, sizeof(100));
^
I am including below header file:
string
If I include string.h or cstring it will pass.
Any idea how to make it work with just string include file? Migrating code base to include string.h or cstring is not an option
EDIT
Yes it was string.
May be I should have phrased it as second option instead of not an option
Before starting code migration, I need to rule out the any possibility of compiler options to make it work work as is.
I can install extra libs if required and change the way it is being compile. Not actually editing the code.