0
votes

My question is similar to this: Error: "warning C4005: 'SWIGTEMPLATEDISAMBIGUATOR': macro redefinition"

I have a similar warning code (changing on 'char16_t'):

xkeycheck.h(179): warning C4005: 'char16_t': macro redefinition

Then:

xkeycheck.h(179): note: argomenti della riga di comando: vedere la precedente definizione di 'char16_t'

(Translation: "note: arugments of the command line: look at the previous definition of 'char16_t')

But it keeps on giving this:

xkeycheck.h(250): fatal error C1189: #error: The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.

Compiler: Visual Studio 2015

1

1 Answers

0
votes

Support for char16_t and char32_t was added to Visual Studio 2015. This means you can no longer create symbols with these names, but then again you don't need them anymore as they already exist.

The solution is to remove the creation of the typedef or macro, or at least guard it when defined(MSC_VER) && _MSC_VER < 1900.

See MSDN:

char_16_t and char32_t You can no longer use char16_t or char32_t as aliases in a typedef, because these types are now treated as built-in. It was common for users and library authors to define char16_t and char32_t as aliases of uint16_t and uint32_t, respectively.

To update your code, remove the typedef declarations and rename any other identifiers that collide with these names.