我对 C++ 很陌生,并且 ClanLib 中的 CL_String8 函数出现错误。
当我尝试编译时:
CL_String now() {
CL_DateTime now = CL_DateTime::get_current_local_time();
return CL_String8(now.get_hour()) + " " + CL_String8(now.get_minutes()) + " " + CL_String8(now.get_seconds());
}
我收到此错误(重复 3 次):
src/utils.cpp: In function ‘CL_String now()’:
src/utils.cpp:15:34: error: call of overloaded ‘CL_String8(unsigned char)’ is ambiguous
src/utils.cpp:15:34: note: candidates are:
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:74:2: note: CL_String8::CL_String8(const wchar_t*) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:74:2: note: no known conversion for argument 1 from ‘unsigned char’ to ‘const wchar_t*’
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:63:2: note: CL_String8::CL_String8(const char*) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:63:2: note: no known conversion for argument 1 from ‘unsigned char’ to ‘const char*’
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:55:2: note: CL_String8::CL_String8(const CL_String8&) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:55:2: note: no known conversion for argument 1 from ‘unsigned char’ to ‘const CL_String8&’
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:50:2: note: CL_String8::CL_String8(const string&) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:50:2: note: no known conversion for argument 1 from ‘unsigned char’ to ‘const string& {aka const std::basic_string<char>&}’
如何定义我要使用的功能之一?