[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] wide-char and g++
Hi,
On tiistai 16 huhtikuu 2013, Helmut Karlowski wrote:
> I'm trying to compile unrar for MiNT. Now that mintlib has
> wide-char-support it's worth a try.
>
> I updated mintlib from cvs to get the wide-char-support, and ran into the
> following error:
>
> strlist.o:strlist.o:(.text+0x20a): undefined reference to
> `wcsncpy(wchar_t*, wchar_t const*, unsigned long)'
>
> and more.
>
> These symbols exist in libc.a, but the prototype in wchar.h has const
> wchar_t* for the second argument.
The first problem with wchar.h is that it's missing the stuff
needed for C++ compatible headers, either:
-------
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif
-------
(wctype.h has them.)
Or maybe:
-------
__BEGIN_DECLS
...
__END_DECLS
-------
> When I write a function for example:
>
> size_t wcslen(wchar_t const* s)
> {
> return wcslen( (const wchar_t*)s);
> }
>
> it works, i.e. the symbol is found.
Is this a C or C++ function?
- Eero