otk
otk

Reputation: 411

C++ compiler errors compiling libpqxx basic exmaple, what is wrong and how to solve it?

im trying to build the example here https://github.com/jtv/libpqxx#programming-with-libpqxx using c++ compiler on my beagleboneblack, ececuting the command: g++ -o taks tasks.cpp -lpqxx -lpq I belive i have installed the lpqxx library with success. Gcc compiler version: gcc (Debian 8.3.0-6) 8.3.0

When compiling i get the following errors (and several other not show here):

 warning: structured bindings only available with -std=c++17 or -std=gnu++17
             for (auto [name, salary] : tx.query<std::string, int>(
                       ^
tasks.cpp:20:43: error: ‘using work = class pqxx::transaction<>’ {aka ‘class pqxx::transaction<>’} has no member named ‘query’
             for (auto [name, salary] : tx.query<std::string, int>(
                                           ^~~~~
tasks.cpp:20:60: error: expected primary-expression before ‘,’ token

The first is a warning, but the others error. Not familiar with C#:

  1. What does these errors mean?
  2. How do i get on solving them?
  3. Is it compiler issues or is it code issues?
  4. I just have one file in my direcory and that is copy-paste of the example from the link, am i missing some header files that define some stuff for me?

Upvotes: 0

Views: 398

Answers (0)

Related Questions