this is somehow a crosspost from the Code::Blocks forum (http://forums.codeblocks.org/index.php/ ... #msg119969).
I try to compile C::B in Linux Mint 12 with wx2.9.3
But i get the following error:
Code: Select all
/trunk/src/include/logmanager.h|24|error: cannot convert ‘const wxStringCharType* {aka const char*}’ to ‘const wxChar* {aka const wchar_t*}’ in assignment|
Code: Select all
inline wxString F(const wxChar* msg, ...)
{
va_list arg_list;
va_start(arg_list, msg);
#if wxCHECK_VERSION(2,9,0) && wxUSE_UNICODE
// in wx >= 2.9 unicode-build (default) we need the %ls here, or the strings get
// cut after the first character
::temp_string = msg;
::temp_string.Replace(_T("%s"), _T("%ls"));
msg = ::temp_string.wx_str();
#endif
::temp_string = wxString::FormatV(msg, arg_list);
va_end(arg_list);
return ::temp_string;
};
Code: Select all
msg = ::temp_string.wx_str();
a search in the wx docs brings this:
Code: Select all
xStringCharType is defined to be:
char when wxUSE_UNICODE==0
char when wxUSE_UNICODE_WCHAR==0 and wxUSE_UNICODE==1
wchar_t when wxUSE_UNICODE_WCHAR==1 and wxUSE_UNICODE==1
The wxUSE_UNICODE_WCHAR symbol is defined to 1 when building on Windows while it's defined to 0 when building on Unix, Linux or OS X. (Note that wxUSE_UNICODE_UTF8 symbol is defined as the opposite of wxUSE_UNICODE_WCHAR.)
Code: Select all
wxChar is defined to be
char when wxUSE_UNICODE==0
wchar_t when wxUSE_UNICODE==1 (the default).
so how can i fix this problem? recompile wx with wxUSE_UNICODE_WCHAR=1 ?
Why is on linux in unicode builds wxChar a wchar_t and not a char?
A general question:
On linux Unicode is UTF-8 or? so can i use char or wchar_t?
sry for my bad english, i hope my questions are somehow understandable
