[英]pqxx::result::tuple has not been declared (PostgreSQL library for c++)
I try to compile program, which uses pqxx (PostgreSQL lib for c++). 我尝试编译使用pqxx(C ++的PostgreSQL库)的程序。 One of my function prototypes, looks like this: 我的函数原型之一如下所示:
bool compare(pqxx::result::tuple row1, pqxx::result::tuple row2);
Compiler says for this line: 编译器对此行说:
classes.h:64:38: error: 'pqxx::result::tuple' has not been declared
bool compare(pqxx::result::tuple row1, pqxx::result::tuple row2);
I have no idea, why I get this error. 我不知道为什么会出现此错误。 I've included pqxx
like this: 我包括了这样的pqxx
:
#include <pqxx/pqxx>
I use in other place pqxx::result
, and it works. 我在其他地方使用pqxx::result
,它可以工作。 Why I cannot delare variable of type pqxx::result::tuple
? 为什么我不能delare类型pqxx::result::tuple
变量?
Thanks, Mike 谢谢,迈克
Looking in the different documentations, pqxx::result::tuple
existed in version 3.1 of the library (see here ). 查看不同的文档,该库的3.1版中存在pqxx::result::tuple
(请参阅此处 )。
It then became pqxx::tuple
in version 4.0 (see here ), and it looks like it disapeared in latest development version (see here , maybe it was droped for std::tuple
). 然后,它在4.0版本中变成了pqxx::tuple
(请参阅此处 ),并且在最新的开发版本中似乎消失了(请参见此处 ,也许它已被std::tuple
删除了)。
So if you're using version 4.0, replace in your code pqxx::result::tuple
with pqxx::tuple
. 因此,如果您使用的是版本4.0, pqxx::result::tuple
代码pqxx::result::tuple
替换为pqxx::tuple
。
If you're using latest development version, try replacing in your code pqxx::result::tuple
with std::tuple
. 如果您使用的是最新开发版本,请尝试用std::tuple
替换代码pqxx::result::tuple
std::tuple
。
EDIT: 编辑:
You found it yourself: in fact, pqxx::tuple
was replaced by pqxx::row
in latest version. 您自己找到了它:实际上,在最新版本中pqxx::tuple
被pqxx::row
取代了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.