Search Postgresql Archives

Re: Load C++ for functions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
// Dmitriy.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux