似乎是vc8中的string的问题
struct reflectable_class_base {
// make sure we have vtable - we need to be able to dynamic_cast to it
virtual ~reflectable_class_base() {}
defs::string object_reflect_name() const { return m_object_reflect_name; }
private:
template<class me> friend struct reflectable_class ;
std::string m_object_reflect_name;
};
object_reflect_name函数出错。
error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(std::basic_string<_Elem,_Traits,_Ax>::_Has_debug_it)' : cannot convert parameter 1 from 'const std::string' to 'std::basic_string<_Elem,_Traits,_Ax>::_Has_debug_it'
struct wnd_tool_info {
wnd_tool_info() : tip_ctrl_name("default"), m_handler(0) {}
// the event handler for this - in case it's null, we need to recreate (window got destroyed, but
// maybe another one with the same ID got created instead)
volatile detail::event_handler_base * m_handler;
// the function to call, when showing tooltip
mutable tooltip_func m_f;
// the tooltip control we're bound to
defs::string tip_ctrl_name;
};
构造函数出错。
error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(std::basic_string<_Elem,_Traits,_Ax>::_Has_debug_it)' : cannot convert parameter 1 from 'const char [8]' to 'std::basic_string<_Elem,_Traits,_Ax>::_Has_debug_it'
注:defs::string == std::string
我的环境是vc2005,默认debug配置,编译win32gui 1.6.7.31,工程属性是Win32Application。
默认release配置时,错误仍是这两处,但是变成了:
error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(const std::allocator<_Ty> &)' : cannot convert parameter 1 from 'const char [8]' to 'const std::allocator<_Ty> &'
error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(const std::basic_string<_Elem,_Traits,_Ax> &)' : cannot convert parameter 1 from 'const std::string' to 'const std::basic_string<_Elem,_Traits,_Ax> &'
单独拿出来这一块做实验(一个朋友试的)似乎没有这个问题。他用的是vc2003。
还有一个可以提供的信息就是,单独编译win32gui(使用它自带的build_library.exe驱动vc8的编译器),没有出现什么问题。成功编译出了lib文件。我觉得这似乎是vc2005 std::string的问题。