How to deal with: redeclaration of C++ built-in type ‘char16_t’ -



How to deal with: redeclaration of C++ built-in type ‘char16_t’ -

in c++11 project have utilize external c library. library main header file defines

typedef uint16_t char16_t;

and because of compilation of c++ programme includes library fails, message:

redeclaration of c++ built-in type ‘char16_t’

the thought have repackage whole library because char16_t pervasive in library time consuming (if possible). there sensible ways of dealing problem?

edit:

i have thought of removing problematic line , replacing every occurrence of char16_t uint16_t have modify 3rd party library headers , not particularly thought (there can more similar errors). wonder whether there way of dealing of broader problem of incompatibilities between c++ , c when including headers.

you utilize macro rename library type while keeping unrelated new language type char16_t:

#define char16_t library_char16_t #include <library> #undef char16_t

then, library header compiled in code base of operations such typedef has name library_char16_t.

the library still compiled such type in question typedef'ed uint16_t should not effort alter (by e.g. removing typedef) in order remain binary-compatible compiled library.

c++ c c++11 compiler-errors

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -