我最近为我的项目安装了 SOCI 库,因为它需要使用 SQLite 数据库。我试图获取行集,但我得到了奇怪的错误:
"c:\mingw\include\soci\exchange-traits.h:35:5: error: incomplete type 'soci::details::exchange_traits<soci::row>' used in nested name specifier".
我不知道我的代码有什么问题......出现该错误的行是:
soci::rowset<> results = (sql.prepare << "SELECT * from games where user_name='" << user.getName() << "'");
顺便说一句,我使用的是最新版本的 SOCI。代码的更广泛部分:
soci::session& sql = conn.getSession();
soci::rowset<> results = (sql.prepare << "SELECT * from games where user_name='" << user.getName() << "'");
for(soci::rowset<>::const_iterator it = results.begin(); it != results.end(); ++it)...