You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
leads to a project file, that can't be compiled (note that I provided the correct libs from log4cplus, however you might need to manually add the UNICODE preprocessor define to anyrpc project).
When compiling the anyrpc-project one gets multiple errors like
binary operator '<<': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
or
'TimeLogger::TimeLogger(const TimeLogger &)' : cannot convert argument n from 'const char [1]' to 'log4cplus::tstring &'.
These errors are caused by calling log4cplus-macros, which obviously expect wchar (or corresponding strings) when compiled with UNICODE-preprocessor define. However the calls by anyrpc are done with simple chars, often fixed strings like "this is an example".
One solution for this problem would be, to use something like TCHAR and _T("my example") (these two only exist in Visual Studio as far as I know), but one would need to change all the logs accordingly.
For myself I found another "solution": In fact I don't really want unicode-logging, but I need the unicode-define enabled in my main project, because it is working with QT and QT needs unicode. So I just compile the dlls for anyrpc & log4cplus without UNICODE-preprocessor defined. In order to include correct headers in my main project, I changed the following lines in logger.h:
Obviously this is neither the cleanest nor a general solution, but this way UNICODE is defined everywhere (where QT needs it) except for the anyrpc / log4cplus part.
Any comments on this topic? Maybe I missed a point or there is a better way to get anyrpc running with unicode?
The text was updated successfully, but these errors were encountered:
Hi,
if I figured it correctly, anyrpc-logging is not working with unicode enabled.
Log4cplus itself supports unicode, for example I was building (on Win7 64bit, VS2015) with
However setting up anyrpc via
leads to a project file, that can't be compiled (note that I provided the correct libs from log4cplus, however you might need to manually add the UNICODE preprocessor define to anyrpc project).
When compiling the anyrpc-project one gets multiple errors like
or
These errors are caused by calling log4cplus-macros, which obviously expect wchar (or corresponding strings) when compiled with UNICODE-preprocessor define. However the calls by anyrpc are done with simple chars, often fixed strings like
"this is an example"
.One solution for this problem would be, to use something like
TCHAR
and_T("my example")
(these two only exist in Visual Studio as far as I know), but one would need to change all the logs accordingly.For myself I found another "solution": In fact I don't really want unicode-logging, but I need the unicode-define enabled in my main project, because it is working with QT and QT needs unicode. So I just compile the dlls for anyrpc & log4cplus without UNICODE-preprocessor defined. In order to include correct headers in my main project, I changed the following lines in logger.h:
Obviously this is neither the cleanest nor a general solution, but this way UNICODE is defined everywhere (where QT needs it) except for the anyrpc / log4cplus part.
Any comments on this topic? Maybe I missed a point or there is a better way to get anyrpc running with unicode?
The text was updated successfully, but these errors were encountered: