From: barreiro@arrakis.es
To: pgsql-interfaces@postgresql.org
Subject: Error linking C++ code.
Date: Mon, 03 May 1999 22:09:32 +0200 (MEST)
Message-ID: <XFMail.990503220931.barreiro@arrakis.es> (raw)
I've problems using postgres with c++
I use postgresql 6.3.2, egcs-c++-1.1b, and the following comand when
compiling the code bellow
gcc -c -o lml.o lml_prueba.cc -I/usr/include/g++ -I/usr/include/pgsql
-L/usr/lib/pgsql -lpq -lpq++ -lstdc++
link give me these errors:
/usr/lib/libpq++.so: undefined reference to
`clone__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_templat
e2b
1i03Rep'
/usr/lib/libpq++.so: undefined reference to
`__dl__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template
2b1
i03RepPv'
/usr/lib/libpq++.so: undefined reference to `__eh_pc'
collect2: ld returned 1 exit status
Can't anybody help me?
Regards.
Code:
-------------------------------------------------------------------------------
/*
Autor: Manuel de Vega Barreiro
primera prueba de acceso a postgres usando c++
version: 0.1- 280499
*/
#include <iostream.h>
#include <libpq++.h>
int main ()
{
cout << "Conexion correcta" <<endl;
PgDatabase data("lml");
if (data.ConnectionBad() ){
cout << "Fallo en la conexion..." <<endl;
cout << "Codigo de error: " << data.ErrorMessage() <<endl;
return 1;
}else{
cout << "Conexion correcta" <<endl;
}
}
----------------------------------------------------------------------------
Manuel de Vega Barreiro. barreiro@arrakis.es En un lugar de la red
Madrid. EspaƱa. de cuyo nombre no quiero
http://www.croftj.net/~barreiro Linux Landia acordarme..........
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: barreiro@arrakis.es
Subject: Re: Error linking C++ code.
In-Reply-To: <XFMail.990503220931.barreiro@arrakis.es>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox