delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/15/18:06:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SARE_SUB_OBFU_Q0,TW_BP,TW_LP
X-Spam-Check-By: sourceware.org
X-Yahoo-SMTP: mjD.OBqswBAPbVUxYJaYPvc61jLEnpq8VnBwJGdbEJOPA9xw
Message-ID: <4C914371.3050701@sbcglobal.net>
Date: Wed, 15 Sep 2010 22:06:41 +0000
From: Greg Chicares <gchicares AT sbcglobal DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Compiling C++ code using libpq-fe.h (PostgreSQL library) in Cygwin
References: <4C913FB4 DOT 90007 AT arcor DOT de>
In-Reply-To: <4C913FB4.90007@arcor.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019