Load C++ for functions?

Поиск
Список
Период
Сортировка
От Elliot Chance
Тема Load C++ for functions?
Дата
Msg-id 158DD0B3-0E48-4632-AF8D-2A258DD5A963@gmail.com
обсуждение исходный текст
Ответы Re: Load C++ for functions?  (Dmitriy Igrishin <dmitigr@gmail.com>)
Re: Load C++ for functions?  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
I'm trying to link up a C++ project with postgres functions, the following code compiles (as C++):

extern "C" {
    #include <postgres.h>
    #include <fmgr.h>

    #ifdef PG_MODULE_MAGIC
    PG_MODULE_MAGIC;
    #endif
};

extern "C" {
    PG_FUNCTION_INFO_V1(pg_xversion);
};
extern "C" Datum pg_xversion(PG_FUNCTION_ARGS)
{
    PG_RETURN_NULL();
}

But the CREATE FUNCTION gives the error:
ERROR:  could not load library "/storage/Scripts/pgx/pgx.so": /storage/Scripts/pgx/pgx.so: undefined symbol:
__gxx_personality_v0

Postgres is no doubt trying to load a C++ linked library as C - is there a way to fix this?

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: When the trigger is called my application is awaiting the finish
Следующее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Load C++ for functions?