简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM