In a C ++ 11 project, I have to use an external C library. This main library header file defines
typedef uint16_t char16_t;
And because of this, compiling a C ++ program that includes this library fails, with the message:
redeclaration of C++ built-in type 'char16_t'
The only idea I have is to repackage the entire library, but since char16_t common in this library, it will be very time consuming (at least possible). Are there any reasonable ways to solve this problem?
Edit:
I have another idea to remove the problematic line and replace every occurrence of char16_t with uint16_t, but I would have to change the headers of third-party libraries, and I don't particularly like this idea (there may be other similar errors). So I also wonder if there is a good way to solve the wider incompatibility problem between C ++ and C when including headers.
source share