0

While I worked to link a library on a new platform, I got the following error:

foo.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

I searched stackoverflow and found this thread: How to set 2 byte wchar_t output?

I saw the answer there and it is really helpful

You can strip the Tag_ABI_PCS_wchar_t tags from your internal gcc object binaries if you truly believe they're sizeof(wchar_t)-agnostic.

Is there an automatic way I can be sure that the library is sizeof(wchar_t)-agnostic?

Thanks

yeger
  • 351
  • 2
  • 15
  • Read the source code. – melpomene Sep 14 '19 at 20:57
  • Thanks for the comment. Do you mean the source code of the library? This is an option for libraries without much dependencies, but I was aiming for a more automatic way. I'll edit the question. – yeger Sep 14 '19 at 21:20
  • instead of stripping the tag you should make sure that *your* code doesn't use any `wchar_t` and set `wchar_t` to what the library uses, unless you're making another library – phuclv Sep 15 '19 at 01:28

0 Answers0