Solved Visual Studio 2017 Character Encoding - Need to select Unicode instead of Multibyte.
#1
I'm trying to build a plug-in using VS2017, but the character encoding in the cmake-generated solution is wrong.  It's set to multibyte, whereas Kodi itself specifies unicode (Kodi is also built with VS2017).

I can't figure out how Kodi was configured to specify unicode rather than multibyte.  I don't see anything in the CMakeLists.txt about the character encoding.  Can someone please lend me a clue?
Reply
#2
Have you passed -DCMAKE_USER_MAKE_RULES_OVERRIDE=<KODI-GIT-DIR>/cmake/scripts/windows/CFlagOverrides.cmake and -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=<KODI-GIT-DIR>/cmake/scripts/windows/CXXFlagOverrides.cmake to cmake?
Reply
#3
Thanks for the reply.

I did pass those command-line arguments to cmake when configuring the build.  The paths were generated (from %~dp0) but I checked to see that the expanded values point to the actual files (they do).  And clearly these files do contain the flags that I need.  How do I go about debugging this situation?  Any further ideas?
Reply
#4
Four days later, and I have tried everything that I can find online.  I even copied the lines from the override files that need to be used, and put them in the CMakeLists.txt (without the "if" checks).  Still I get a solution that is multi-byte character set, and of course will not build.

This is getting to be extremely frustrating.

Is there something different about VS2017, where defining UNICODE and _UNICODE are not enough to force unicode character set?  Kodi has it in its generated solution.  I am using VS2017 because I am unable to get VS2015 to install the 10.0.14393 SDK -- the SDK fails to install for me, and I'm apparently not alone.

Any clues?  I'm trying to get a plugin building with cmake so I can submit it, and this is blocking me.  It builds and runs fine on Linux, but that's Linux.
Reply
#5
This was my error.  I had forked the p8-platform code from the wrong location (from pulse-eight instead from xbmc) and thus did not see any upstream updates.  The Windows code is completely different in the two locations.
Reply

Logout Mark Read Team Forum Stats Members Help
Visual Studio 2017 Character Encoding - Need to select Unicode instead of Multibyte.0