Re: Calling C++ function - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Calling C++ function
Date
Msg-id 28455.1092594458@sss.pgh.pa.us
Whole thread Raw
In response to Calling C++ function  (Oliver Archner <oliver.archner@bitoek.uni-bayreuth.de>)
Responses Re: Calling C++ function
List pgsql-interfaces
Oliver Archner <oliver.archner@bitoek.uni-bayreuth.de> writes:
> Can anyone point me to example which calls a C++ function from a dynamic 
> library ?

It's gonna be fairly painful, since the backend is a C program not a C++
program, and therefore it does not provide any of the infrastructure
that C++ code is likely to expect --- no exception stack, no global
constructors/destructors, no C++ library, etc.  I am not sure how much
of this is practical to load after-the-fact in a dynamic library.

My inclination if you really need to use ImageMagick would be to shell
out to the IM executable via system() (or better popen(), if you have a
modern popen that supports 'r+' access).
        regards, tom lane


pgsql-interfaces by date:

Previous
From: pgsql@groks.org
Date:
Subject: Type implemented in plpythonu crashes backend
Next
From: Tom Lane
Date:
Subject: Re: Type implemented in plpythonu crashes backend