Re: Help with adding C-Language Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Seamus Thomas Carroll <carrolls(at)cpsc(dot)ucalgary(dot)ca>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Help with adding C-Language Functions
Date: 2005-02-10 20:43:39
Message-ID: 2358.1108068219@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Seamus Thomas Carroll <carrolls(at)cpsc(dot)ucalgary(dot)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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Fuhr 2005-02-10 22:15:05 Re: Function return number of affected rows
Previous Message Seamus Thomas Carroll 2005-02-10 19:55:44 Re: Help with adding C-Language Functions