wchar_t str = L"a" is impossible in android-ndk.

563 views
Skip to first unread message

Adam Kim

unread,
May 23, 2012, 10:42:23 PM5/23/12
to andro...@googlegroups.com
Hi!

I want to use wchar_t and do as following.

wchar_t str[260] = {0};
wcscpy(str, L"This is WCHAR");

But 'L' makes error in ndk.
How can I fix it? or how can I set string to wchar_t?

Help me.

Gulfas

unread,
May 24, 2012, 4:56:45 AM5/24/12
to android-ndk
I compiled and executed that without problems on an emulator Platform
4.03 API Level 15 ARM

What's your target API level?

MeKa

unread,
May 24, 2012, 1:50:22 AM5/24/12
to andro...@googlegroups.com
What kind of error...

2012/5/24 Adam Kim <adam1...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/ceWhx9D9VtUJ.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.

Adam Kim

unread,
May 24, 2012, 5:01:16 AM5/24/12
to andro...@googlegroups.com
I use android-ndk-r8 & android-14
But wchar_t a = L" "; still makes error.
Isn't it because NDK problem?

2012년 5월 24일 목요일 오후 4시 56분 45초 UTC+8, Gulfas 님의 말:

Adam Kim

unread,
May 24, 2012, 5:12:06 AM5/24/12
to andro...@googlegroups.com
Hi MeKa
I cann't use 'L' macro for constant string like L""
If I use wchar_t, I should also be able to use L macro.
But I cann't. What's wrong with me?

2012년 5월 24일 목요일 오후 5시 1분 16초 UTC+8, Adam Kim 님의 말:

David Turner

unread,
May 24, 2012, 7:16:28 AM5/24/12
to andro...@googlegroups.com
On Thu, May 24, 2012 at 11:12 AM, Adam Kim <adam1...@gmail.com> wrote:
Hi MeKa
I cann't use 'L' macro for constant string like L""
If I use wchar_t, I should also be able to use L macro.
But I cann't. What's wrong with me?

You still didn't say which exact "error" you're getting. Also which API level are you targetting? wchar_t wasn't supported officially until API level 9, before that the type is only 8 bit.
 
2012년 5월 24일 목요일 오후 5시 1분 16초 UTC+8, Adam Kim 님의 말:
I use android-ndk-r8 & android-14
But wchar_t a = L" "; still makes error.
Isn't it because NDK problem?

2012년 5월 24일 목요일 오후 4시 56분 45초 UTC+8, Gulfas 님의 말:
I compiled and executed that without problems on an emulator Platform
4.03 API Level 15 ARM

What's your target API level?



On May 24, 3:42 am, Adam Kim <adam1988...@gmail.com> wrote:
> Hi!
>
> I want to use wchar_t and do as following.
>
> wchar_t str[260] = {0};
> wcscpy(str, L"This is WCHAR");
>
> But 'L' makes error in ndk.
> How can I fix it? or how can I set string to wchar_t?
>
> Help me.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/tlf087kmN9gJ.
Reply all
Reply to author
Forward
0 new messages