pqxx::result::tuple has not been declared (PostgreSQL library for c++)

耗尽温柔 提交于 2019-12-08 03:57:56

问题


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);

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:

#include <pqxx/pqxx>

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

Thanks, Mike


回答1:


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

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).

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

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

EDIT:

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



来源:https://stackoverflow.com/questions/43890357/pqxxresulttuple-has-not-been-declared-postgresql-library-for-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!