X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7C6E75E46FA for ; Sun, 15 Aug 2004 15:27:46 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59327-09 for ; Sun, 15 Aug 2004 18:27:41 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 923A35E46F4 for ; Sun, 15 Aug 2004 15:27:40 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i7FIRcM2028456; Sun, 15 Aug 2004 14:27:39 -0400 (EDT) To: Oliver Archner Cc: pgsql-interfaces@postgresql.org Subject: Re: Calling C++ function In-reply-to: <411CB6B8.1050909@bitoek.uni-bayreuth.de> References: <411CB6B8.1050909@bitoek.uni-bayreuth.de> Comments: In-reply-to Oliver Archner message dated "Fri, 13 Aug 2004 14:40:24 +0200" Date: Sun, 15 Aug 2004 14:27:38 -0400 Message-ID: <28455.1092594458@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/19 X-Sequence-Number: 5067 Oliver Archner 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