PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5

From: Yu Cao <yucao(at)falcon(dot)kla-tencor(dot)com>
To: pgsql-ports(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5
Date: 1999-09-04 05:41:49
Message-ID: Pine.SOL.3.96.990903220649.4375B-100000@jedi.kla-tencor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-ports

There is a problem with libpq++.so on IRIX 6.5 (MIPSpro 7.2.1, -n32).
If you compile and link a simple program like the following:

#include "libpq++/pgdatabase.h"

main(int argc, char **argv)
{
PgDatabase *db = new PgDatabase("dbname=mydb");
db->Exec("SELECT * FROM TEST");
db->PrintTuples();
delete db;
}

and run it, you'll get the following error:

46407:./a.out: rld: Error: unresolvable symbol in
/5xxRoot/ALG/pgsql/lib/libpq++.so.3.0:
__node_allocator_lock__Q2_3std45__default_alloc_template__pt__13_XCbL11XCiL10
46407:./a.out: rld: Error: unresolvable symbol in
/5xxRoot/ALG/pgsql/lib/libpq++.so.3.0:
free_list__Q2_3std45__default_alloc_template__pt__13_XCbL11XCiL10
46407:./a.out: rld: Fatal Error: this executable has unresolvable symbols

I think this has to do with some quirks of the SGI MIPSpro compiler when
creating libraries for C++. For shared library, instead of "ld -shared",
"CC -shared" should be used to enable pre-linking (for template
instantiation). And for static library, "CC -ar" should be used instead
of "ar" (although right now if I use the static library the run-time error
does not occur).

I'm not sure whether using "CC" to create libraries for the pure C
modules would work (my guess is it should and I'll try it). If it does
then it'll be easy to patch the IRIX makefile template. But then the
downside is people will be required to have the C++ compiler even if
they don't care about libpq++.

--Yu Cao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 1999-09-04 14:04:31 temp table oddness?
Previous Message Peter Blazso 1999-09-03 22:57:29 array manipulations

Browse pgsql-ports by date

  From Date Subject
Next Message Ross Sieber 1999-09-04 12:45:21 Re: undefined reference to 'crypt'
Previous Message Leiradella, Andre V Matos Da Cunha 1999-09-03 17:45:26