Problema C++, libqxx y postgresql

From: "Andres Jaramillo" <anjarami(at)gmail(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Problema C++, libqxx y postgresql
Date: 2006-10-17 22:40:54
Message-ID: 9cdddb600610171540r54551afcsac6356a97ce78ba8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola a tdos y gracias por leerme a ver si alguien me puede ayudar.

Tengo el problema de q no logro conectarme a postgresql con libqxx,
tengo este archivo de prueba

--------

#include <iostream>
#include <pqxx/pqxx>

using namespace std;
using namespace pqxx;

int main()
{
connection C;
return 0;
}

---------

ya con eso me saca cualquier cantidad de errores q pego al final del mensaje...

tengo instalado postgresql 8.0 en /usr/local/pgsql/ en una maquina
centos 4.3 compilo mi programa asi g++ test001.cpp -o test001 la
version del compilador g++ (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)

La verdad no se ni como decirle a libqxx cual es la base de datos y el
usuario lo raro es q cuando compile libqxx corri los test y pasaron
menos 4 y son como 70.

gracias...

Los errores del compildor son los siguientes:

test001.cpp:38:2: warning: no newline at end of file
/tmp/ccB3GImH.o(.text+0x145): In function `main':
: undefined reference to `pqxx::connection_base::dbname()'
/tmp/ccB3GImH.o(.text+0x1c5): In function `main':
: undefined reference to `pqxx::transaction_base::exec(char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&)'
/tmp/ccB3GImH.o(.text+0x239): In function `main':
: undefined reference to `pqxx::result::size() const'
/tmp/ccB3GImH.o(.text+0x426): In function `main':
: undefined reference to `pqxx::transaction_base::exec(char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&)'
/tmp/ccB3GImH.o(.text+0x4ab): In function `main':
: undefined reference to `pqxx::transaction_base::commit()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZNK4pqxx6result5field5c_strEv+0x34):
In function `pqxx::result::field::c_str() const':
: undefined reference to `pqxx::result::GetValue(unsigned long,
unsigned int) const'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZNK4pqxx6result3endEv+0x14): In
function `pqxx::result::end() const':
: undefined reference to `pqxx::result::size() const'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx8internal7PQAllocI9pg_resultED2Ev+0x1f):
In function `pqxx::internal::PQAlloc<pg_result>::~PQAlloc()':
: undefined reference to `pqxx::internal::refcount::~refcount()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx16basic_connectionINS_14connect_directEEC1Ev+0x15):
In function `pqxx::basic_connection<pqxx::connect_direct>::basic_connection()':
: undefined reference to
`pqxx::connection_base::connection_base(pqxx::connectionpolicy&)'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx16basic_connectionINS_14connect_directEEC1Ev+0x4e):
In function `pqxx::basic_connection<pqxx::connect_direct>::basic_connection()':
: undefined reference to `pqxx::connection_base::init()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx14connect_directD1Ev+0xb): In
function `pqxx::connect_direct::~connect_direct()':
: undefined reference to `vtable for pqxx::connect_direct'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx14connect_directD1Ev+0x16): In
function `pqxx::connect_direct::~connect_direct()':
: undefined reference to `pqxx::connectionpolicy::~connectionpolicy()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx14connect_directC1ERKSs+0x10):
In function `pqxx::connect_direct::connect_direct(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to
`pqxx::connectionpolicy::connectionpolicy(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx14connect_directC1ERKSs+0x1c):
In function `pqxx::connect_direct::connect_direct(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `vtable for pqxx::connect_direct'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx16basic_connectionINS_14connect_directEED1Ev+0xf):
In function `pqxx::basic_connection<pqxx::connect_direct>::~basic_connection()':
: undefined reference to `pqxx::connection_base::close()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EEC1ERNS_15connection_baseE+0x9c):
In function `pqxx::transaction<(pqxx::isolation_level)0>::transaction(pqxx::connection_base&)':
: undefined reference to
`pqxx::dbtransaction::fullname(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&)'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EEC1ERNS_15connection_baseE+0x228):
In function `pqxx::transaction<(pqxx::isolation_level)0>::transaction(pqxx::connection_base&)':
: undefined reference to
`pqxx::basic_transaction::basic_transaction(pqxx::connection_base&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&)'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EEC1ERNS_15connection_baseE+0x296):
In function `pqxx::transaction<(pqxx::isolation_level)0>::transaction(pqxx::connection_base&)':
: undefined reference to `pqxx::transaction_base::Begin()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD2Ev+0x1e):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `pqxx::dbtransaction::~dbtransaction()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EED1Ev+0x17):
In function `pqxx::transaction<(pqxx::isolation_level)0>::~transaction()':
: undefined reference to `pqxx::transaction_base::End()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx8internal7PQAllocI9pg_resultE7loserefEv+0x11):
In function`pqxx::internal::PQAlloc<pg_result>::loseref()':
: undefined reference to `pqxx::internal::refcount::loseref()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx8internal7PQAllocI9pg_resultE7freememEv+0xf):
In function `pqxx::internal::PQAlloc<pg_result>::freemem()':
: undefined reference to `pqxx::internal::freemem_result(pg_result*)'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE+0x14):
undefined reference to `pqxx::dbtransaction::do_begin()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE+0x18):
undefined reference to `pqxx::dbtransaction::do_exec(char const*)'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE+0x1c):
undefined reference to `pqxx::basic_transaction::do_commit()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE+0x20):
undefined reference to `pqxx::dbtransaction::do_abort()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_17basic_transactionE+0x8):
undefined reference to `typeinfo for pqxx::basic_transaction'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_17basic_transactionE+0x14):
undefined reference to `pqxx::dbtransaction::do_begin()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_17basic_transactionE+0x18):
undefined reference to `pqxx::dbtransaction::do_exec(char const*)'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_17basic_transactionE+0x1c):
undefined reference to `pqxx::basic_transaction::do_commit()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_17basic_transactionE+0x20):
undefined reference to `pqxx::dbtransaction::do_abort()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_13dbtransactionE+0x8):
undefined reference to `typeinfo for pqxx::dbtransaction'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_13dbtransactionE+0xc):
undefined reference to `pqxx::dbtransaction::~dbtransaction()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_13dbtransactionE+0x10):
undefined reference to `pqxx::dbtransaction::~dbtransaction()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_13dbtransactionE+0x14):
undefined reference to `pqxx::dbtransaction::do_begin()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_13dbtransactionE+0x18):
undefined reference to `pqxx::dbtransaction::do_exec(char const*)'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTCN4pqxx11transactionILNS_15isolation_levelE0EEE0_NS_13dbtransactionE+0x20):
undefined reference to `pqxx::dbtransaction::do_abort()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD0Ev+0xa):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `vtable for pqxx::basic_transaction'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD0Ev+0x14):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `VTT for pqxx::basic_transaction'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD0Ev+0x20):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `pqxx::dbtransaction::~dbtransaction()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD1Ev+0xa):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `vtable for pqxx::basic_transaction'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD1Ev+0x14):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `VTT for pqxx::basic_transaction'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx17basic_transactionD1Ev+0x20):
In function `pqxx::basic_transaction::~basic_transaction()':
: undefined reference to `pqxx::dbtransaction::~dbtransaction()'
/tmp/ccB3GImH.o(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EED0Ev+0x17):
In function `pqxx::transaction<(pqxx::isolation_level)0>::~transaction()':
: undefined reference to `pqxx::transaction_base::End()'
/tmp/ccB3GImH.o(.gnu.linkonce.r._ZTIN4pqxx11transactionILNS_15isolation_levelE0EEE+0x8):
undefinedreference to `typeinfo for pqxx::basic_transaction'
collect2: ld returned 1 exit status

--
===
Andres Jaramillo
anjarami(at)gmail(dot)com
anjarami(at)hotmail(dot)com
===

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Omar Zeballos (Kantutani) 2006-10-17 22:57:57 Instalacion Perl
Previous Message WILLIAM PARRA 2006-10-17 19:51:43 Re: Offtopic: J2EE y postgres