Re: Help with adding C-Language Functions

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

Предыдущее
От: Seamus Thomas Carroll
Дата:
Сообщение: Re: Help with adding C-Language Functions
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Function return number of affected rows