From: Seamus Thomas Carroll <carrolls@cpsc.ucalgary.ca>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Help with adding C-Language Functions
Date: Thu, 10 Feb 2005 16:17:11 -0700 (MST)
Message-ID: <Pine.LNX.4.60.0502101608560.5503@frost> (raw)
In-Reply-To: <2358.1108068219@sss.pgh.pa.us>
References: <Pine.LNX.4.60.0502091954340.5503@frost>
<Pine.LNX.4.60.0502100114310.5503@frost>
<27779.1108056673@sss.pgh.pa.us>
<Pine.LNX.4.60.0502101251550.5503@frost>
<2358.1108068219@sss.pgh.pa.us>
Hi Tom,
I am trying to LOAD the .so file and i have replaced the add_one function(
this one compiled and tested after adding the extern "C"{}) with the
concat_text function.
It compiles but when i try the LOAD command i get the following error:
ERROR: could not load library "/home/grads/.../BlackboardFunctions.so":
/home/grads/.../BlackboardFunctions.so: undefined symbol: _Z16pg_detoast_datumP7varlena
I am guessing this has something to do with the varlena in c.h.
Seamus
On Thu, 10 Feb 2005, Tom Lane wrote:
> Seamus Thomas Carroll <carrolls@cpsc.ucalgary.ca> writes:
>> I have c++ classes i want to use but when i complile using g++ i get the
>> error (cant find function x in file.so). Does anyone have experience
>> compiling c++ and loading the function?
>
> The immediate problem is that you didn't declare the function as extern
> "C" so it doesn't follow C naming conventions. In general, though, it's
> fairly difficult to use any interesting C++ capabilities in a Postgres
> backend module, because the main backend does not contain the C++
> library. So, for instance, I'd not expect C++ exceptions or RTTI to
> work at all well.
>
> regards, tom lane
>
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: carrolls@cpsc.ucalgary.ca, tgl@sss.pgh.pa.us
Subject: Re: Help with adding C-Language Functions
In-Reply-To: <Pine.LNX.4.60.0502101608560.5503@frost>
* 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