Re: Load C++ for functions?

From: Elliot Chance <elliotchance(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Load C++ for functions?
Date: 2010-12-24 12:16:47
Message-ID: BE2BB6D8-2E68-472C-9D70-F4BA80AF0E62@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cheers! It works.

On 24/12/2010, at 11:13 PM, Dmitriy Igrishin wrote:

> Hey Elliot,
>
> See http://www.postgresql.org/docs/9.0/static/extend-cpp.html
>
> Probably compiling with -fno-exceptions solve you problem.
>
> 2010/12/24 Elliot Chance <elliotchance(at)gmail(dot)com>
> 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?
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
>
> --
> // Dmitriy.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-12-24 12:22:24 Re: Load C++ for functions?
Previous Message Dmitriy Igrishin 2010-12-24 12:13:00 Re: Load C++ for functions?