none
VS 2015 RC linker std::codecvt error

    Question

  • Hi,

    I'm geting an STL-related link error, using Microsoft Visual Studio Community 2015 RC (Version 14.0.22823.1 D14REL)

    I'm linking a C++ DLL and successfully using many functions from the STL, but it can't find stuff 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)

    The source code reference causing this issue:

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


    My code generation is for multithread dll,  and I have verified through verbose linking that MSVCPRT.lib is being searched  at link time.

    Any ideas ?



    Wednesday, June 10, 2015 5:59 PM

Answers

  • Yes, this is a known issue. It is not yet fixed, and may not be fixed before RTM. However, you should be able to use unsigned int or __int32 instead of char32_t to get the correct results.

    Scot


    Developer Support Engineer

    Wednesday, June 10, 2015 10:25 PM

All replies

  • Yes, this is a known issue. It is not yet fixed, and may not be fixed before RTM. However, you should be able to use unsigned int or __int32 instead of char32_t to get the correct results.

    Scot


    Developer Support Engineer

    Wednesday, June 10, 2015 10:25 PM
  • Thanks for the reply Scot, it's helpful to know :)
    Thursday, June 11, 2015 12:54 AM
  • I logged this on connect a few weeks ago: https://connect.microsoft.com/VisualStudio/feedback/details/1348277/link-error-when-using-std-codecvt-utf8-utf16-char16-t
    Thursday, June 11, 2015 8:46 AM
  • Thanks!

    By the way what's the practical diff between these two sites ? Is one the 'official' support or community for all things Visual*? 

    https://connect.microsoft.com/VisualStudio

     

    https://social.msdn.microsoft.com/Forums/en-US/user/forums (visual c++ forum, etc.)

     
    Thursday, June 11, 2015 1:20 PM
  • The "Connect" site is for communicating directly to the product group for VS.  The responses there may be limited to things like

    "Tell us how to reproduce it, because we haven't been able to do so yet", and
    "Yes, thanks for telling us, we'll fix it in a future version" and
    "This is by design, sorry.  But here's a workaround", etc.
    Connect is very useful in helping to make sure our PG knows about problems.  You can also find existing reports and increase the "me too" count so they know which issues are impacting the most people.

    The "Social" site, on the other hand, is primarily so that people sharing a common interest in a product can ask questions and give each other answers or share experiences.  From time to time, you will also see Microsoft employees like myself monitoring and replying to threads, but often the answers will come from other users who aren't MSFT.

    Scot


    Developer Support Engineer

    Thursday, June 11, 2015 7:42 PM
  • Visual Studio is Version 14.0.24720.00 Update 1 now, and this bug is still there!

    I have this code which produce the same error:

    std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> utf16_conv;
    std::u16string utf16_string = utf16_conv.from_bytes(utf8_string);

    Is there a workaround for UTF-16 conversion? I assume char16_t is broken as is with char32_t?

    Wednesday, January 06, 2016 8:43 PM
  • Use wchar_t or unsigned short instead of char16_t, and it should work.

    This is an active bug in our database (VSO#143857), which we'll investigate for a future release, but we're currently working on higher priority things.

    • Proposed as answer by mloskot Sunday, January 31, 2016 5:32 PM
    Thursday, January 07, 2016 8:12 PM