libpqxx - Beispiel "test001.cxx" lässt sich nicht kompilieren (bzw. linken)
Liebe Mailinglisten Leser!
Vorweg sei gleich gesagt, dass ich nur sehr wenig Ahnung von C++ habe. :-(
Ich habe mir heute die libpqxx näher ansehen wollen, und bin dabei auf
folgendes Problem gestoßen:
leo@veneto:~/C++/Postgresql Beispiele$ g++ test001.cxx
/tmp/cc54Du46.o: In function `main':test001.cxx:(.text+0x2c): undefined
reference to `pqxx::connection::connection()'
:test001.cxx:(.text+0x12a): undefined reference to
`pqxx::transaction_base::exec(char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
:test001.cxx:(.text+0x182): undefined reference to `pqxx::result::empty()
const'
:test001.cxx:(.text+0x373): undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char> > pqxx::to_string<unsigned
long>(unsigned long const&)'
:test001.cxx:(.text+0x53f): undefined reference to
`pqxx::transaction_base::commit()'
:test001.cxx:(.text+0x618): undefined reference to
`pqxx::connection::~connection()'
:test001.cxx:(.text+0x645): undefined reference to
`pqxx::connection::~connection()'
/tmp/cc54Du46.o:
(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE[vtable
for pqxx::transaction<(pqxx::isolation_level)0>]+0x10): undefined reference
to `pqxx::basic_transaction::do_begin()'
/tmp/cc54Du46.o:
(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE[vtable
for pqxx::transaction<(pqxx::isolation_level)0>]+0x14): undefined reference
to `pqxx::dbtransaction::do_exec(char const*)'
/tmp/cc54Du46.o:
(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE[vtable
for pqxx::transaction<(pqxx::isolation_level)0>]+0x18): undefined reference
to `pqxx::basic_transaction::do_commit()'
/tmp/cc54Du46.o:
(.gnu.linkonce.r._ZTVN4pqxx11transactionILNS_15isolation_levelE0EEE[vtable
for pqxx::transaction<(pqxx::isolation_level)0>]+0x1c): undefined reference
to `pqxx::basic_transaction::do_abort()'
/tmp/cc54Du46.o:
(.gnu.linkonce.r._ZTIN4pqxx11transactionILNS_15isolation_levelE0EEE[typeinfo
for pqxx::transaction<(pqxx::isolation_level)0>]+0x8): undefined reference to
`typeinfo for pqxx::basic_transaction'
/tmp/cc54Du46.o: In function
`pqxx::internal::PQAlloc<pg_result>::freemem()':test001.cxx:
(.gnu.linkonce.t._ZN4pqxx8internal7PQAllocI9pg_resultE7freememEv[pqxx::internal::PQAlloc<pg_result>::freemem()]+0x10):
undefined reference to `pqxx::internal::freemem_result(pg_result*)'
/tmp/cc54Du46.o: In function `pqxx::result::field::c_str() const':test001.cxx:
(.gnu.linkonce.t._ZNK4pqxx6result5field5c_strEv[pqxx::result::field::c_str()
const]+0x3a): undefined reference to `pqxx::result::GetValue(unsigned long,
unsigned int) const'
/tmp/cc54Du46.o: In function `pqxx::result::field::is_null()
const':test001.cxx:
(.gnu.linkonce.t._ZNK4pqxx6result5field7is_nullEv[pqxx::result::field::is_null()
const]+0x3a): undefined reference to `pqxx::result::GetIsNull(unsigned long,
unsigned int) const'
/tmp/cc54Du46.o: In function `pqxx::result::end() const':test001.cxx:
(.gnu.linkonce.t._ZNK4pqxx6result3endEv[pqxx::result::end() const]+0x11):
undefined reference to `pqxx::result::size() const'
/tmp/cc54Du46.o: In function
`pqxx::basic_transaction::~basic_transaction()':test001.cxx:
(.gnu.linkonce.t._ZN4pqxx17basic_transactionD2Ev[pqxx::basic_transaction::~basic_transaction()]+0x7):
undefined reference to `vtable for pqxx::basic_transaction'
:test001.cxx:
(.gnu.linkonce.t._ZN4pqxx17basic_transactionD2Ev[pqxx::basic_transaction::~basic_transaction()]+0x18):
undefined reference to `pqxx::dbtransaction::~dbtransaction()'
/tmp/cc54Du46.o: In function `pqxx::transaction<(pqxx::isolation_level)
0>::transaction(pqxx::connection_base&, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':test001.cxx:
(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EEC1ERNS_15connection_baseERKSs[pqxx::transaction<(pqxx::isolation_level)
0>::transaction(pqxx::connection_base&, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)]+0x40): undefined
reference to
`pqxx::basic_transaction::basic_transaction(pqxx::connection_base&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&)'
:test001.cxx:
(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EEC1ERNS_15connection_baseERKSs[pqxx::transaction<(pqxx::isolation_level)
0>::transaction(pqxx::connection_base&, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)]+0x93): undefined
reference to `pqxx::transaction_base::Begin()'
/tmp/cc54Du46.o: In function `pqxx::transaction<(pqxx::isolation_level)
0>::~transaction()':test001.cxx:
(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EED1Ev[pqxx::transaction<(pqxx::isolation_level)
0>::~transaction()]+0x18): undefined reference to
`pqxx::transaction_base::End()'
/tmp/cc54Du46.o: In function `pqxx::transaction<(pqxx::isolation_level)
0>::~transaction()':test001.cxx:
(.gnu.linkonce.t._ZN4pqxx11transactionILNS_15isolation_levelE0EED0Ev[pqxx::transaction<(pqxx::isolation_level)
0>::~transaction()]+0x18): undefined reference to
`pqxx::transaction_base::End()'
collect2: ld returned 1 exit status
Habe mir dann gedacht "OK, hast etwas übersehen." und den Quellcode in ein
neues KDevelop Projekt kopiert.
Geht dort aber auch nicht.
Bin heute schon zu müde um weiter zu machen. Aber vielleicht weiß ja einer auf
die Schnelle eine Antwort. :-)
LG,
Leonhard.
Reply to: