This is the mail archive of the
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
> 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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html