Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3FGJRu73915 for ; Sun, 15 Apr 2001 12:19:27 -0400 (EDT) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from sand2.global.net.uk (sand2.global.net.uk [195.147.246.100]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3FG8ku71893 for ; Sun, 15 Apr 2001 12:08:47 -0400 (EDT) (envelope-from Stephen.Jackson@panting-deer.org.uk) Received: from pa1s04a03.client.global.net.uk ([195.147.164.162] helo=panting-deer.org.uk) by sand2.global.net.uk with esmtp (Exim 3.16 #1) id 14op4s-0007YB-00; Sun, 15 Apr 2001 17:08:43 +0100 Message-ID: <3AD9C7F5.902BAE74@panting-deer.org.uk> Date: Sun, 15 Apr 2001 17:10:29 +0100 From: Stephen Jackson X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Lonnie Cumberland CC: pgsql-interfaces@postgresql.org Subject: Re: [SQL] g++ not working for postgresql extension languages? References: <20010415004615.35217.qmail@web12508.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200104/45 X-Sequence-Number: 1428 Lonnie, C++ uses "name mangling" to permit overloading of functions. Therefore your function concat_text() ends up with a very different name. You can probably get round this as follows: #ifdef __cplusplus extern "C" { #endif text * concat_text(text *arg1, text *arg2); #ifdef __cplusplus } #endif This tells the C++ compiler that concat_text is a "C" name - so don't do name mangling. This is a common technique for making C++ code callable from C, although I haven't used it in the specific context you are using. Hope this helps, Stephen Jackson Home: Stephen.Jackson@panting-deer.org.uk www.panting-deer.org.uk Work: Stephen.Jackson@looksystems.co.uk www.looksystems.co.uk Lonnie Cumberland wrote: > > Hi All again, > > One more thing that I have tried. > > If I now do a similar thing as in my previous message with the "funcs.c" file, > but this time with the "funcs.cc" file then I can get: > [snip] > > trdata=# select concat_text('a','b'); > ERROR: Can't find function concat_text in file /test/funcs.so > trdata=# > -------------------------------------------------------------------------- > [snip] > > text * > concat_text(text *arg1, text *arg2); > [snip] > so now I do not understand why the "gcc" version works and the "g++" version > does not? > > Just a side note in that I can easliy compile c++ the examples in the > interfaces/libpq++ directory without any problems so that this is very strange > to me. > > I really need the "g++" version to work correctly as well? > > Any ideas anyone? > > Cheers > Lonnie >