After using libpq-fe.h in the past, for a new project I'm starting use pqxx.
So, in the code I include:
#include <pqxx/pqxx>
And I compile. Everything fine.
When I declare:
pqxx::connection p_con;
And I compile, I have errors:
obj/Debug/src/dbfunc.o: In function `pqxx::connect_direct::connect_direct(std::string const&)':
/usr/include/pqxx/connection.hxx:87: undefined reference to `pqxx::connectionpolicy::connectionpolicy(std::string const&)'
/usr/include/pqxx/connection.hxx:87: undefined reference to `vtable for pqxx::connect_direct'
obj/Debug/src/dbfunc.o: In function `pqxx::connect_direct::~connect_direct()':
/usr/include/pqxx/connection.hxx:84: undefined reference to `vtable for pqxx::connect_direct'
/usr/include/pqxx/connection.hxx:84: undefined reference to `pqxx::connectionpolicy::~connectionpolicy()'
obj/Debug/src/dbfunc.o: In function `pqxx::basic_connection<pqxx::connect_direct>::basic_connection()':
/usr/include/pqxx/basic_connection.hxx:61: undefined reference to `pqxx::connection_base::connection_base(pqxx::connectionpolicy&)'
/usr/include/pqxx/basic_connection.hxx:62: undefined reference to `pqxx::connection_base::init()'
obj/Debug/src/dbfunc.o: In function `pqxx::basic_connection<pqxx::connect_direct>::~basic_connection()':
/usr/include/pqxx/basic_connection.hxx:78: undefined reference to `pqxx::connection_base::close()'
A search on google indicates that this is not a library problem.
Infact: a very similar problem, same error, was already solved here: Problem compiling program with pqxx
I don't get how to solve it in code::blocks. Any suggestion?
Software versions:
- Code::Blocks 13.12
- Os: Debian 8.2
- Libpqxx: libpqxx-4.0
- Compiler used: gcc
- gcc --version: gcc (Debian 4.9.2-10) 4.9.2
I am relatively new to using code::blocks, so probably I'm missing something :-/
EDIT: As requested the 2 path:
- /usr/lib/x86_64-linux-gnu/libpq.so
- /usr/lib/x86_64-linux-gnu/libpq.a