Hello,
i'm compiling C::B svn from source with wx2.9.3 unicode build on Linux Mint 12
I get this errors:
/trunk/src/include/logmanager.h|24|error: cannot convert 'const wxStringCharType* {aka const char*}' to 'const wxChar* {aka const wchar_t*}' in assignment|
for this code:
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;
};
from wx docs:
wxStringCharType 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.)
and for wxChar:
wxChar is defined to be
char when wxUSE_UNICODE==0
wchar_t when wxUSE_UNICODE==1 (the default).
so the error looks obvious, if i compile wx under linux with wxUNICODE (what is standart wxVer > 2.9) wxChar is wchar_t and the internal representation for wxString is char. wx_str() returns char*.
Did i have to recompile wx with wxUSE_UNICODE_WCHAR=1 ?
Is this then UTF-16 ?
thx!
Quote from: BlueHazzard on February 08, 2013, 03:23:55 PM
i'm compiling C::B svn from source with wx2.9.3 unicode build on Linux Mint 12
Don't use wx2.9 at least if you want to port it to this version of wx, otherwise use wx2.8.
C::B is not fully working on wx2.9 and if you want to use 2.9 use the latest on 2.9.4 or directly from svn.
Hi, BlueHazzard, there are further discussion about this issue, see:
Re: F() function is not thread safe? (http://forums.next.codeblocks.org/index.php/topic,18773.msg132267.html#msg132267)