I am porting a quite large C/C++ project to Mac with XCode. Some C++ classes import string or vector. This causes some strange errors reporting redefinition of several std functions. For example the compiler reports redefinition of 'std::__is_integral' in <type_traits>.
I don’t get any other errors and I definitely don’t overwrite any of these std-functions. Also the error vanishes when I comment the include of string.
What might cause this behavior?
It turned out that somewhere in the C++ code – which I inherited for this project – there was a redefinition of
bool.boolwas redefined asint. Therefore in thetype_traitsheader (and some other std-lib headers) there were duplicate method definitions of generic methods that hat abooland anintgeneric parameter.For example in type_traits there is:
and
As
boolwas redefined as int both methods had the same signature and I got thisredefinition of...error.