Article View: es.comp.os.linux.programacion
Article #15071Re: Compilar fuente C que accede a postgres?
From: Daniel Varela Santoalla
Date: Thu, 24 Aug 2000 00:00
Date: Thu, 24 Aug 2000 00:00
70 lines
2726 bytes
2726 bytes
This is a multi-part message in MIME format. --------------052FAFEECD1A155824E473EC Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit La librer�a me temo que se llama libpq.so, no libpg.so, as� que ... gcc -o pru -L/path/de/librer�a pru.o -lpq �no? sau wrote: > > Borja wrote: > > > > El otro dia preguntaba como se compilaba un fuente en C que accede a BdD > > Postgres y me respondio "batsman" esto: > > > > ------------------------------------ > > Procura separar compilar/enlazar. > > Primero > > gcc -c pru.c -I/usr/include/pgsql > > despu�s > > gcc -o pru -L/path/de/librer�a pru.o -lpg > > Suponiendo que tienes la librer�a libpg.so en /path/de/librer�a > > -------------------------------------- > > > > Lo he hecho Y me dice que no encuentra la biblioteca: > > > > ----------------------------------------------- > > [sistemas@piton ejem1]$ gcc -c pru.c -I/usr/include/pgsql > > [sistemas@piton ejem1]$ gcc -o pru -L/usr/lib pru.o -lpg > > /usr/bin/ld: cannot open -lpg: No such file or directory > > collect2: ld returned 1 exit status > > [sistemas@piton ejem1]$ > > ------------------------------------------------ > > > > No tengo el fichero "libpg.so" en el dir "/usr/lib" -> tengo el "libpg.so.2" > > > > Sabe alguien que me puede ocurrir (No tengo ningun problema en acceso a > > traves de perl) > puede que debas actualizar manualmento los links. Ejecutad ldconfig, > para ver los errores de links que puedas tener, y los arraglas si no lo > hace automaticamente. --------------052FAFEECD1A155824E473EC Content-Type: text/x-vcard; charset=us-ascii; name="dvarela.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Daniel Varela Santoalla Content-Disposition: attachment; filename="dvarela.vcf" begin:vcard n:Varela Santoalla;Daniel tel;cell:0 tel;fax:666-5555 tel;home:555-6666 tel;work:91-3483896 x-mozilla-html:FALSE org:INDRA-Net adr:;;;;;; version:2.1 email;internet:dvarela@coms.vel.indra.es fn:Daniel Varela Santoalla end:vcard --------------052FAFEECD1A155824E473EC--
Technical Details
Message-ID:
<39A546F9.613BB4C4@coms.vel.indra.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8n0f18$een$1@talia.mad.ttd.net> <3993D077.64DB7C78@quitaspamwanadoo.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,301934f33b7b630e X-Google-Attributes: gidf86c8,public From: Daniel Varela Santoalla <dvarela@coms.vel.indra.es> Subject: Re: Compilar fuente C que accede a postgres? Date: 2000/08/24 Message-ID: <39A546F9.613BB4C4@coms.vel.indra.es> X-Deja-AN: 662013351 References: <8n0f18$een$1@talia.mad.ttd.net> <3993D077.64DB7C78@quitaspamwanadoo.es> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------052FAFEECD1A155824E473EC" Organization: INDRA Mime-Version: 1.0 Newsgroups: es.comp.os.linux.programacion