Linker error using VS 2015 RC, cannot find character associated with std :: codecvt

I get an STL related link using Microsoft Visual Studio Community 2015 RC (version 14.0.22823.1 D14REL)

I am linking the C ++ DLL and am successfully using many functions from STL, but I can not find material related to std :: codecvt:

error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::locale::id std::codecvt<char32_t,char,struct _Mbstatet>::id" ( __imp_?id@ ?$codecvt@ _UDU_Mbstatet@ @@ std@ @ 2V0locale@2 @A) 

Link to the source code causing this problem:

 std::wstring_convert< std::codecvt_utf8<char32_t>, char32_t > convert; 

My code generation is for a multi-threaded DLL, and I checked through a detailed link that MSVCPRT.lib is being executed during the link time.

Any ideas?

+6
source share
1 answer

To clarify the problem and solution: Microsoft acknowledged that std::codecvt not built for the char32_t library in std that ships with Microsoft Visual Studio 2015 RC. A workaround is to use unsigned int or __int32 :

  std::wstring_convert< std::codecvt_utf8<unsigned int>, unsigned int > convert; 

or

  std::wstring_convert< std::codecvt_utf8<__int32>, __int32 > convert; 

instead

  std::wstring_convert< std::codecvt_utf8<char32_t>, char32_t > convert; 
+3
source

Source: https://habr.com/ru/post/988868/


All Articles