以下代码:生成错误消息,如下:
bool UACmUsers::GetUser(int userid) {
soci::session sql(dbU::Connection());
sql << "SELECT userid, username, password FROM uac_users WHERE userid = \":user\"",
soci::use(userid),
soci::into(iDuserid, indUserid),
soci::into(sDusername, indUsername), // This is line 61.
soci::into(sDpassword, indPassword);
return true;
}
dbU::Connection()
是一个生成连接字符串的函数。
iDuserid
、sDusername
和sDpassword
是 UACmUsers 的私有成员,属于 和int
类型std::string
。
indUserid
、indUsername
和indPassword
是 UACmUsers 的私有成员,类型为soci::indicator
。
有第二个重载函数搜索username
. 如果我注释掉这个函数,只剩下第二个函数,编译器会指向第二个函数中的同一点。
bool UACmUsers::GetUser(const wxString& username);
我已经尝试删除两个指标,但这并不能解决问题。
错误:
E:\cpp\lib\soci\soci-4.0.0\include\soci/exchange-traits.h(41): error C2065: 'x_type': undeclared identifier
E:\cpp\lib\soci\soci-4.0.0\include\soci/bind-values.h(207): note: see reference to class template instantiation 'soci::details::exchange_traits<T>' being compiled
with
[
T=wxString
]
E:\cpp\lib\soci\soci-4.0.0\include\soci/bind-values.h(143): note: see reference to function template instantiation 'void soci::details::into_type_vector::exchange_<wxString,soci::indicator>(const soci::details::into_container<wxString,soci::indicator> &,...)' being compiled
E:\cpp\lib\soci\soci-4.0.0\include\soci/statement.h(50): note: see reference to function template instantiation 'void soci::details::into_type_vector::exchange<wxString,soci::indicator>(const soci::details::into_container<wxString,soci::indicator> &)' being compiled
E:\cpp\lib\soci\soci-4.0.0\include\soci/statement.h(199): note: see reference to function template instantiation 'void soci::details::statement_impl::exchange<wxString,soci::indicator>(const soci::details::into_container<wxString,soci::indicator> &)' being compiled
E:\cpp\lib\soci\soci-4.0.0\include\soci/ref-counted-statement.h(92): note: see reference to function template instantiation 'void soci::statement::exchange<wxString,soci::indicator>(const soci::details::into_container<wxString,soci::indicator> &)' being compiled
E:\cpp\lib\soci\soci-4.0.0\include\soci/once-temp-type.h(49): note: see reference to function template instantiation 'void soci::details::ref_counted_statement::exchange<const soci::details::into_container<wxString,soci::indicator>>(T &)' being compiled
with
[
T=const soci::details::into_container<wxString,soci::indicator>
]
E:\cpp\dev\Manager\src\UAC\models\UACmUsers.cpp(61): note: see reference to function template instantiation 'soci::details::once_temp_type &soci::details::once_temp_type::operator ,<wxString,soci::indicator>(const soci::details::into_container<wxString,soci::indicator> &)' being compiled
有人可以帮我让 SOCI 表现得更好吗?