Thread: libpq linking problem
Hi! I'm considering using postgreSQL via the libpq interface with an application I'm developing in C. I tried compiling one of the example programs (the first one) from the libpq documentation. I received the following error: % gcc test.c -lpq /usr/lib/libpq.so: undefined reference to 'crypt' Does anyone know what the problem might be? I'm on a Redhat Linux 2.2.5-15 system, with the following installations: gcc: egcs 2.91.66 ld: 2.9.1 postgreSQL: 6.4.2-3 Thanks for your help. ----- Emil Malmberg Programmer Icon Medialab Denmark +45 3338 4958 emil@iconmedialab.dk www.iconmedialab.dk
On Mon, Dec 13, 1999 at 09:59:45AM +0100, Emil Malmberg wrote: > I'm considering using postgreSQL via the libpq interface with an > application I'm developing in C. I tried compiling one of the example I hope you know that there is also an embedded SQL interface. :-) > ... > % gcc test.c -lpq > /usr/lib/libpq.so: undefined reference to 'crypt' Just add -lcrypt. Glibc2 needs to add it. Michael -- Michael Meskes | Go SF 49ers! Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire! Tel.: (+49) 2431/72651 | Use Debian GNU/Linux! Email: Michael@Fam-Meskes.De | Use PostgreSQL!