Обсуждение: Port Bug Report: compile errors for embedded sql (in c)
============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : Nathan
Your email address : nathan@khmere.com
Category : unknown
Severity : non-critical
Summary: compile errors for embedded sql (in c)
System Configuration
--------------------
Operating System : Linux 2.2.5-15smp i586 (redHat 6.0)
PostgreSQL version : 6.4.2-3
Compiler used : gcc 2.7
Hardware:
---------
Linux ns4.khmere.com 2.2.5-15smp #1 SMP Mon Apr 19 22:03:51 EDT 1999 i586 unknown
Versions of other tools:
------------------------
make and just straight gcc
--------------------------------------------------------------------------
Problem Description:
--------------------
I get this error when I complie ?
(I am not a new 'c' programmer but I am new to embedded sql)
/usr/lib/libecpg.so: undefined reference to `crypt'
collect2: ld returned 1 exit status
--------------------------------------------------------------------------
Test Case:
----------
This is what I use to compile
gcc -g -o 2easql 2easql.c -I /usr/include/pgsql/
-L /usr/include/pgsql/lib -lecpg -lpq
--------------------------------------------------------------------------
Solution:
---------
--------------------------------------------------------------------------
> I get this error when I complie ?
> (I am not a new 'c' programmer but I am new to embedded sql)
> /usr/lib/libecpg.so: undefined reference to `crypt'
> collect2: ld returned 1 exit status
>
> --------------------------------------------------------------------------
>
> Test Case:
> ----------
> This is what I use to compile
> gcc -g -o 2easql 2easql.c -I /usr/include/pgsql/
> -L /usr/include/pgsql/lib -lecpg -lpq
Do this:
gcc -g -o 2easql 2easql.c -I /usr/include/pgsql/
-L /usr/include/pgsql/lib -lecpg -lpq -lcrypt
^^^^^^^
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026