Re: Help with adding C-Language Functions
От | Seamus Thomas Carroll |
---|---|
Тема | Re: Help with adding C-Language Functions |
Дата | |
Msg-id | Pine.LNX.4.60.0502101608560.5503@frost обсуждение исходный текст |
Ответ на | Re: Help with adding C-Language Functions (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Help with adding C-Language Functions
|
Список | 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 по дате отправления: