'wstring_convert' was not declared in this scope

319 views
Skip to first unread message

yaoyaoyu...@163.com

unread,
Aug 12, 2016, 4:38:50 AM8/12/16
to crystax-ndk
I use wstring_convert from <codecvt> on VC,but it can't work on NDK,then I try to use crystax-ndk.Although the crystax-ndk includes <codecvt>,but it still can't use wstring_convert
how to solve this?thanks

Dmitry Moskalchuk

unread,
Aug 12, 2016, 7:20:39 AM8/12/16
to cryst...@googlegroups.com

Hello,

Please describe it more detailed. What you mean by "can't use wstring_convert"? Is there any compilation issue? Or linker issue? Or is it crashed on device? Ideally, minimal example would be very helpful.

-- 
Dmitry Moskalchuk
On 12/08/16 11:37, yaoyaoyu...@163.com wrote:
I use wstring_convert from <codecvt> on VC,but it can't work on NDK,then I try to use crystax-ndk.Although the crystax-ndk includes <codecvt>,but it still can't use wstring_convert
how to solve this?thanks
--
You received this message because you are subscribed to the Google Groups "crystax-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crystax-ndk...@googlegroups.com.
To post to this group, send email to cryst...@googlegroups.com.
Visit this group at https://groups.google.com/group/crystax-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystax-ndk/e0572d0b-9715-4cb4-9dda-01ba3d6e5b96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daegon Kim

unread,
May 14, 2017, 6:17:09 AM5/14/17
to crystax-ndk
I'm facing a similar problem. When I try to compile through ndk-build, I get the following error:

```
error: 'wstring_convert' is not a member of 'std'
    std::wstring_convert<convert_typeX, wchar_t> converterX;
```

Here's the code:

                static std::wstring s2ws( const std::string str )
{
typedef std::codecvt_utf8<wchar_t> convert_typeX;
std::wstring_convert<convert_typeX, wchar_t> converterX;

return converterX.from_bytes( str );
}
static std::string ws2s( const std::wstring wstr )
{
typedef std::codecvt_utf8<wchar_t> convert_typeX;
std::wstring_convert<convert_typeX, wchar_t> converterX;

return converterX.to_bytes( wstr );
}

My application.mk is the following:

APP_STL := c++_shared

# Enable c++11 extentions in source code
APP_CPPFLAGS += -std=c++14

#APP_ABI := armeabi armeabi-v7a x86
APP_ABI := armeabi armeabi-v7a

# Min SDK level
APP_PLATFORM=android-10
Reply all
Reply to author
Forward
0 new messages