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 19F238BA0C9 for ; Thu, 10 Feb 2005 20:44:48 +0000 (GMT) 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 98634-01 for ; Thu, 10 Feb 2005 20:44:17 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 383EE8B9D19 for ; Thu, 10 Feb 2005 20:44:17 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1AKhdkE002359; Thu, 10 Feb 2005 15:43:39 -0500 (EST) To: Seamus Thomas Carroll Cc: pgsql-interfaces@postgresql.org Subject: Re: Help with adding C-Language Functions In-reply-to: References: <27779.1108056673@sss.pgh.pa.us> Comments: In-reply-to Seamus Thomas Carroll message dated "Thu, 10 Feb 2005 12:55:44 -0700" Date: Thu, 10 Feb 2005 15:43:39 -0500 Message-ID: <2358.1108068219@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/40 X-Sequence-Number: 5285 Seamus Thomas Carroll writes: > I have c++ classes i want to use but when i complile using g++ i get the > error (cant find function x in file.so). Does anyone have experience > compiling c++ and loading the function? The immediate problem is that you didn't declare the function as extern "C" so it doesn't follow C naming conventions. In general, though, it's fairly difficult to use any interesting C++ capabilities in a Postgres backend module, because the main backend does not contain the C++ library. So, for instance, I'd not expect C++ exceptions or RTTI to work at all well. regards, tom lane