From: Tom Lane <tgl@sss.pgh.pa.us>
To: William Torrez Corea <willitc9888@gmail.com>
Cc: pgsql-general@lists.postgresql.org, Rob Sargent <robjsargent@gmail.com>
Subject: Re: collect2: error: ld returned 1 exit status
Date: Sat, 26 Nov 2022 18:46:21 -0500
Message-ID: <233831.1669506381@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGiORHfFmxqqwdodLA31D-sgUsoueDAtp+3RxxC3aG9RhpHL4w@mail.gmail.com>
References: <CAGiORHdght_E931whpv-W0UjxfnLE2tDBWZ9AN13rxHGdRn+9Q@mail.gmail.com>
<050D1AE9-0D5B-433D-8C82-938FB5BA3191@gmail.com>
<CAGiORHfFmxqqwdodLA31D-sgUsoueDAtp+3RxxC3aG9RhpHL4w@mail.gmail.com>
William Torrez Corea <willitc9888@gmail.com> writes:
> On Sat, Nov 26, 2022 at 5:00 PM Rob Sargent <robjsargent@gmail.com> wrote:
>> On Nov 26, 2022, at 3:43 PM, William Torrez Corea <willitc9888@gmail.com>
>> wrote:
>>> Compile the code:
>>> *sudo cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq*
>>> But i get the following error:
>>> *collect2: error: ld returned 1 exit status*
The useful info would be in the lines right before that one. That
one just tells you that cc is giving up because of prior errors.
>> And do you have at hand why the loader (ld) failed?
> Package libpq was not found in the pkg-config search path.
> Perhaps you should add the directory containing `libpq.pc'
> to the PKG_CONFIG_PATH environment variable
I do not believe that a bare cc invocation would produce any
complaints about pkg-config. Are you showing us something
unrelated to the stated command?
BTW, it's pretty hard to believe that you need to use sudo
for this.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, willitc9888@gmail.com, robjsargent@gmail.com
Subject: Re: collect2: error: ld returned 1 exit status
In-Reply-To: <233831.1669506381@sss.pgh.pa.us>
References: <CAGiORHdght_E931whpv-W0UjxfnLE2tDBWZ9AN13rxHGdRn+9Q@mail.gmail.com> <050D1AE9-0D5B-433D-8C82-938FB5BA3191@gmail.com> <CAGiORHfFmxqqwdodLA31D-sgUsoueDAtp+3RxxC3aG9RhpHL4w@mail.gmail.com> <233831.1669506381@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox