Received: from smtp06.mail.onemain.com (SMTP-OUT003.ONEMAIN.COM [63.208.208.73]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f279Ipx24862 for ; Wed, 7 Mar 2001 04:18:53 -0500 (EST) (envelope-from egm2@jps.net) Received: (qmail 18217 invoked from network); 7 Mar 2001 08:06:03 -0000 Received: from unknown (HELO localhost) ([216.119.36.79]) (envelope-sender ) by smtp06.mail.onemain.com (qmail-ldap-1.03) with SMTP for ; 7 Mar 2001 08:06:03 -0000 Received: from felix by localhost with local (Exim 3.22 #1 (Debian)) id 14aYx7-0004C0-00 for ; Wed, 07 Mar 2001 00:05:45 -0800 Date: Wed, 7 Mar 2001 00:05:45 -0800 From: "Eric G. Miller" To: pgsql-general@postgresql.org Subject: Re: Undefined symbol Message-ID: <20010307000545.A16035@calico.local> Mail-Followup-To: "Eric G. Miller" , pgsql-general@postgresql.org References: <3AA5765F.75350FEA@inet-interactif.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: <3AA5765F.75350FEA@inet-interactif.com>; from boulat@inet-interactif.com on Tue, Mar 06, 2001 at 06:44:31PM -0500 X-Archive-Number: 200103/323 X-Sequence-Number: 5807 On Tue, Mar 06, 2001 at 06:44:31PM -0500, Boulat Khakimov wrote: > Hi, > > Im writing a function in C (encode) for PG that uses blowfish encryption > here is how I compile it. > > gcc -I/usr/src/postgresql-7.0.3/src/include > -I/usr/src/postgresql-7.0.3/src/backend -O2 -Wall -Wmissing-prototypes > -Wmissing-declarations -lcrypt > -I/usr/src/postgresql-7.0.3/src/interfaces/libpq > -I/usr/src/postgresql-7.0.3/src/include -fpic > -I/home/boulat/Funio.com/database/libblowfish.a -c -o encode.o > encode.c I suspect you want ... -L/usr/src/postgresql-7.0.3/src/interfaces/ /home/boulat/Funio.com/database/libblowfish.a -c -o encode -lpq But I wonder if, libblowfish.a is compiled with position independent code *and* if libpq is reachable by the backend database. I don't think your libblowfish is getting linked into the object. > it compiles nicely with 0 error or warnings, > > then i do > gcc -shared -o encode.so encode.o > rm encode.o > > so now im left we a ready to go encode.so , So now I add that function > to DB > > testdb=# CREATE FUNCTION encode(text,text) > testdb-# RETURNS text > testdb-# AS '/home/boulat/Funio.com/database/encode.so' > testdb-# LANGUAGE 'C'; > CREATE > > no problems there either, BUT ... > > testdb=# select encode('bob','bob'); > ERROR: Load of file /home/boulat/Funio.com/database/encode.so failed: > /home/boulat/Funio.com/database/encode.so: undefined symbol: > BF_cfb64_encrypt > > thats the function that I call from inside my c code... > but Why??? It compiled with no errors or warning, and I have all the > right includes in my source code. > > Im confused! > > Any help would be appreciated. > > Regards, > Boulat Khakimov > > -- > Nothing Like the Sun > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > -- Eric G. Miller