pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedError linking C++ code.
8+ messages / 3 participants
[nested] [flat]
* Error linking C++ code.
@ 1999-05-02 18:31 barreiro@arrakis.es
0 siblings, 0 replies; 8+ messages in thread
From: barreiro@arrakis.es @ 1999-05-02 18:31 UTC (permalink / raw)
To: pgsql-interfaces; +Cc: barreiro@arrakis.es
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..........
^ permalink raw reply [nested|flat] 8+ messages in thread
* Error linking C++ code.
@ 1999-05-02 19:37 barreiro@arrakis.es
0 siblings, 0 replies; 8+ messages in thread
From: barreiro@arrakis.es @ 1999-05-02 19:37 UTC (permalink / raw)
To: pgsql-interfaces; +Cc: barreiro@arrakis.es
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..........
^ permalink raw reply [nested|flat] 8+ messages in thread
* Error linking C++ code.
@ 1999-05-03 19:45 barreiro@arrakis.es
0 siblings, 0 replies; 8+ messages in thread
From: barreiro@arrakis.es @ 1999-05-03 19:45 UTC (permalink / raw)
To: pgsql-interfaces
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..........
^ permalink raw reply [nested|flat] 8+ messages in thread
* Error linking C++ code.
@ 1999-05-03 20:09 barreiro@arrakis.es
0 siblings, 1 reply; 8+ messages in thread
From: barreiro@arrakis.es @ 1999-05-03 20:09 UTC (permalink / raw)
To: pgsql-interfaces
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..........
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: [INTERFACES] Error linking C++ code.
@ 1999-05-04 06:40 Pavel PaJaSoft Janousek <janousek@fonet.cz>
0 siblings, 1 reply; 8+ messages in thread
From: Pavel PaJaSoft Janousek @ 1999-05-04 06:40 UTC (permalink / raw)
To: barreiro@arrakis.es; +Cc: pgsql-interfaces
>I use postgresql 6.3.2, egcs-c++-1.1b, and the following comand when
>compiling the code bellow
I use EGCS distributed with RH 5.1 (I think, that it is buggy version
1.0.2), libraries from this distribution too (lacking memory and other
problems I know, now I'm waiting for CD with RH 6.0) and ECPG distributed
with PostgreSQL 6.4.2 (I use this version of PostgreSQL too). In this
configuration is using ECPG without problems, so You can try upgrade to
newer version of developer tools....
-------------------------------------------------------------------------
Pavel Janousek (PaJaSoft) FoNet, spol. s r. o.
Vyvoj software, sprava siti, Unix, Web, Y2K Anenska 11, 602 00 Brno
E-mail: mailto:Janousek@FoNet.Cz Tel.: +420 5 4324 4749
SMS: mailto:P.Janousek@SMS.Paegas.Cz Fax.: +420 5 4324 4751
WWW: http://WWW.FoNet.Cz/ E-mail: mailto:Info@FoNet.Cz
--------------------------------------------------------------------------
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: [INTERFACES] Error linking C++ code.
@ 1999-05-04 06:45 Michael Meskes <meskes@postgreSQL.org>
parent: barreiro@arrakis.es
0 siblings, 1 reply; 8+ messages in thread
From: Michael Meskes @ 1999-05-04 06:45 UTC (permalink / raw)
To: barreiro@arrakis.es; +Cc: pgsql-interfaces
On Mon, May 03, 1999 at 10:09:32PM +0200, barreiro@arrakis.es wrote:
> gcc -c -o lml.o lml_prueba.cc -I/usr/include/g++ -I/usr/include/pgsql
> -L/usr/lib/pgsql -lpq -lpq++ -lstdc++
Hmm, this command line is kind of strange. First of all the c++ compiler is
named g++ not gcc. Then it seems you only want to compile and link the code
(hence the -c) but why do you give linker options (-l*)?
Anyway, I removed the -c option on my system (PostgreSQL 6.4.2 and egcc
1.1.2) and it works nicely.
Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net | Use PostgreSQL!
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: [INTERFACES] Error linking C++ code.
@ 1999-05-10 19:13 barreiro@arrakis.es
parent: Michael Meskes <meskes@postgreSQL.org>
0 siblings, 0 replies; 8+ messages in thread
From: barreiro@arrakis.es @ 1999-05-10 19:13 UTC (permalink / raw)
To: Michael Meskes <meskes@postgreSQL.org>; +Cc: pgsql-interfaces
On 04-May-99 Michael Meskes wrote:
> On Mon, May 03, 1999 at 10:09:32PM +0200, barreiro@arrakis.es wrote:
>> gcc -c -o lml.o lml_prueba.cc -I/usr/include/g++ -I/usr/include/pgsql
>> -L/usr/lib/pgsql -lpq -lpq++ -lstdc++
>
> Hmm, this command line is kind of strange. First of all the c++ compiler is
> named g++ not gcc. Then it seems you only want to compile and link the code
> (hence the -c) but why do you give linker options (-l*)?
>
That's right Michael, I use g++ but I write this mail to hasty.
6.4.2 postgres release solve my problems.
Thank's
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..........
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: [INTERFACES] Error linking C++ code.
@ 1999-05-10 19:13 barreiro@arrakis.es
parent: Pavel PaJaSoft Janousek <janousek@fonet.cz>
0 siblings, 0 replies; 8+ messages in thread
From: barreiro@arrakis.es @ 1999-05-10 19:13 UTC (permalink / raw)
To: Pavel PaJaSoft Janousek <janousek@fonet.cz>; +Cc: pgsql-interfaces
On 04-May-99 Pavel PaJaSoft Janousek wrote:
>>I use postgresql 6.3.2, egcs-c++-1.1b, and the following comand when
>>compiling the code bellow
>
>
> I use EGCS distributed with RH 5.1 (I think, that it is buggy version
> 1.0.2), libraries from this distribution too (lacking memory and other
> problems I know, now I'm waiting for CD with RH 6.0) and ECPG distributed
> with PostgreSQL 6.4.2 (I use this version of PostgreSQL too). In this
> configuration is using ECPG without problems, so You can try upgrade to
> newer version of developer tools....
>
Thank's Pavel, I've upgrade to 6.4.2 and all work well now (egcs 1.1b is ok).
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..........
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~1999-05-10 19:13 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-02 18:31 Error linking C++ code. barreiro@arrakis.es
1999-05-02 19:37 Error linking C++ code. barreiro@arrakis.es
1999-05-03 19:45 Error linking C++ code. barreiro@arrakis.es
1999-05-03 20:09 Error linking C++ code. barreiro@arrakis.es
1999-05-04 06:45 ` Michael Meskes <meskes@postgreSQL.org>
1999-05-10 19:13 ` barreiro@arrakis.es
1999-05-04 06:40 Re: [INTERFACES] Error linking C++ code. Pavel PaJaSoft Janousek <janousek@fonet.cz>
1999-05-10 19:13 ` barreiro@arrakis.es
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