Re: Help with adding C-Language Functions - Mailing list pgsql-interfaces

From Seamus Thomas Carroll
Subject Re: Help with adding C-Language Functions
Date
Msg-id Pine.LNX.4.60.0502101608560.5503@frost
Whole thread Raw
In response to Re: Help with adding C-Language Functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Help with adding C-Language Functions
List pgsql-interfaces
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
>


pgsql-interfaces by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Function return number of affected rows
Next
From: Tom Lane
Date:
Subject: Re: Help with adding C-Language Functions