X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E3ACC3A1D13 for ; Sat, 1 Jan 2005 19:20:44 +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 05480-05 for ; Sat, 1 Jan 2005 19:20:39 +0000 (GMT) Received: from fed1rmmtao07.cox.net (fed1rmmtao07.cox.net [68.230.241.32]) by svr1.postgresql.org (Postfix) with ESMTP id C15143A2183 for ; Sat, 1 Jan 2005 19:20:38 +0000 (GMT) Received: from [192.168.1.202] (really [68.111.226.8]) by fed1rmmtao07.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP id <20050101192037.DYEA21886.fed1rmmtao07.cox.net@[192.168.1.202]>; Sat, 1 Jan 2005 14:20:37 -0500 Message-ID: <41D6F804.9060703@acm.org> Date: Sat, 01 Jan 2005 11:20:36 -0800 From: TJ O'Donnell Reply-To: tjo@acm.org User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jose Mendoza Cc: pgsql-sql@postgresql.org Subject: Re: Function in C++ References: <0I9C00AKWDR2ER@smtp.prodigy.net.mx> In-Reply-To: <0I9C00AKWDR2ER@smtp.prodigy.net.mx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/1 X-Sequence-Number: 19789 All I do is write a c interface with postgresql, using the standard method described in the documentation. There are example in the src code tree, too. The only "trick" is to declare my c++ functions to be callable by c, like in this example: extern "C" int oe_smarts_match(char *smi, char *sma) { .c++ code ... } Then my c interface code calls oe_smarts_match. I hope this helps. Let me know if you need more details or examples. TJ Jose Mendoza wrote: > > > I would like to have, only if it is possible, a small example of how can > be that done. I have this problem now because I have a very light > interface using the ODBC and with the same code I can connect to > Postgresql (servers Linux) and SQLserver (servers Windows). And the > libpq++ works in C++ if I reject the idea of use ODBC. > > > > Any help will be appreciated. > > > > Thans > > > > Jose Mendoza > > unixos@prodigy.net.mx > > > > > > >