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

From Tom Lane
Subject Re: Help with adding C-Language Functions
Date
Msg-id 2358.1108068219@sss.pgh.pa.us
Whole thread Raw
In response to Re: Help with adding C-Language Functions  (Seamus Thomas Carroll <carrolls@cpsc.ucalgary.ca>)
Responses Re: Help with adding C-Language Functions  (Seamus Thomas Carroll <carrolls@cpsc.ucalgary.ca>)
List pgsql-interfaces
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: Seamus Thomas Carroll
Date:
Subject: Re: Help with adding C-Language Functions
Next
From: Michael Fuhr
Date:
Subject: Re: Function return number of affected rows