This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Compiling C++ code using libpq-fe.h (PostgreSQL library) in Cygwin
- From: Greg Chicares <gchicares at sbcglobal dot net>
- To: cygwin at cygwin dot com
- Date: Wed, 15 Sep 2010 22:06:41 +0000
- Subject: Re: Compiling C++ code using libpq-fe.h (PostgreSQL library) in Cygwin
- References: <4C913FB4.90007@arcor.de>
On 2010-09-15 21:50Z, Julia Jacobson wrote:
>
> When trying to compile C++ code using PostgreSQL's libpq-fe.h by the command "g++
> -I/usr/include -L/lib -lpq my_program.cpp", I get error messages like "undefined
> reference to '_PQconnectdb'.
Assuming that '-lpq' provides the unresolved symbol,
move it after the file that requires it:
g++ -I/usr/include my_program.cpp -L/lib -lpq
See the details under '-l' in 'man ld'.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple