Skip site navigation (1) Skip section navigation (2)

Re: Calling C++ function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Archner <oliver(dot)archner(at)bitoek(dot)uni-bayreuth(dot)de>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Calling C++ function
Date: 2004-08-15 18:27:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Oliver Archner <oliver(dot)archner(at)bitoek(dot)uni-bayreuth(dot)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

In response to


pgsql-interfaces by date

Next:From: Tom LaneDate: 2004-08-15 19:02:10
Subject: Re: Type implemented in plpythonu crashes backend
Previous:From: Tom LaneDate: 2004-08-13 17:49:49
Subject: Re: large object I/O seeing \\xxx encoding with v3 protocol

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group