This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Static linking issue under cygwin.
Vladimir A. Petrov wrote:
> I've faced with strange static linking issue in Cygwin environment.
> Trivial C program can not be linked against PostgreSQL libpq with the
> following diagnostics:
>
> $ gcc -Wall -I /cygdrive/c/Program\ Files/PostgreSQL/8.2/include/ -L
> /cygdrive/c/Program\ Files/PostgreSQL/8.2/lib -lpq -o pgtest.exe
> pgtest.c
> /cygdrive/c/DOCUME~1/vap/LOCALS~1/Temp/cclXAlCk.o:pgtest.c:(.text+0x33):
> undefined reference to `_PQconnectdb'
Not strange, when gnu ld depends on order of libraries for static linking.
ld doesn't rescan libraries when new references are added after the scan.
It's strange enough to attempt to link libraries installed under "Program
Files"
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/