本文介绍了pqxx :: result :: tuple尚未声明(用于C ++的PostgreSQL库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试编译使用pqxx(C ++的PostgreSQL库)的程序。我的函数原型之一如下所示:

I try to compile program, which uses pqxx (PostgreSQL lib for c++). One of my function prototypes, looks like this:

bool compare(pqxx::result::tuple row1, pqxx::result::tuple row2);

编译器对这一行说:

classes.h:64:38: error: 'pqxx::result::tuple' has not been declared
   bool compare(pqxx::result::tuple row1, pqxx::result::tuple row2);

我不知道为什么会出现此错误。我已经包括了 pqxx

I have no idea, why I get this error. I've included pqxx like this:

#include <pqxx/pqxx>

我在其他地方使用 pqxx :: result ,并且有效。为什么我不能删除类型为 pqxx :: result :: tuple 的变量?

I use in other place pqxx::result, and it works. Why I cannot delare variable of type pqxx::result::tuple ?

谢谢,迈克

推荐答案

在不同的文档中, pqxx :: result :: tuple 存在库的3.1(请参见)。

Looking in the different documentations, pqxx::result::tuple existed in version 3.1 of the library (see here).

然后在版本4.0中变为 pqxx :: 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 :: result :: tupl e pqxx :: tuple

So if you're using version 4.0, replace in your code pqxx::result::tuple with pqxx::tuple.

如果您使用的是最新开发版本,请尝试用 std :: tuple 替换代码 pqxx :: result :: tuple

If you're using latest development version, try replacing in your code pqxx::result::tuple with std::tuple.

编辑:

您自己找到了:实际上, pqxx: :tuple 替换为的最新版本。

You found it yourself: in fact, pqxx::tuple was replaced by pqxx::row in latest version.

这篇关于pqxx :: result :: tuple尚未声明(用于C ++的PostgreSQL库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 19:16