From: Jonathan W. <my...@ka...> - 2011-02-11 09:37:34
|
2011/2/11 韩彦军(Hammer): > Hi all, in the example ssqls1.cpp I want to convert the sql_decimal type > to the ordinary c++ double via the following statements: > > double d; > d = it->price; > > but I got errors when compiling as follows: > > lib/null.h: In member function ‘mysqlpp::Null<Type, Behavior>::operator > Type() const [with Type = double, Behavior = mysqlpp::NullIsNull]’: > examples/ssqls1.cpp:72:13: instantiated from here > lib/null.h:55:2: error: ‘mysqlpp::null_type::operator > CannotConvertNullToAnyOtherDataType() const [with > CannotConvertNullToAnyOtherDataType = double]’ is protected > lib/null.h:232:29: error: within this context > make: *** [ssqls1_ssqls1.o] Error 1 > > Besides, when I convert sql_mediatext type to the c++ string via: > > string s; > s = it->description; > > I got a similar error: > > lib/null.h: In member function ‘mysqlpp::Null<Type, Behavior>::operator > Type() const [with Type = std::basic_string<char>, Behavior = > mysqlpp::NullIsNull]’: > examples/ssqls1.cpp:72:13: instantiated from here > lib/null.h:55:2: error: ‘mysqlpp::null_type::operator > CannotConvertNullToAnyOtherDataType() const [with > CannotConvertNullToAnyOtherDataType = std::basic_string<char>]’ is protected > lib/null.h:232:29: error: within this context > make: *** [ssqls1_ssqls1.o] Error 1 > > I searched the archive and didn't find any solution. Any suggestion? > Thank you very much! Wrong mailing list - it looks like you're using mysql++ now (which is good) but it has its own mailing list. This list is only for the defunct mysqlcppapi project. See http://tangentsoft.net/mysql++ |