pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedcollect2: error: ld returned 1 exit status
8+ messages / 3 participants
[nested] [flat]
* collect2: error: ld returned 1 exit status
@ 2022-11-26 22:43 William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: William Torrez Corea @ 2022-11-26 22:43 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
I am using libpq: the C application programmer's interface to PostgreSQL.
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*
>
--
With kindest regards, William.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
@ 2022-11-26 22:59 ` Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Rob Sargent @ 2022-11-26 22:59 UTC (permalink / raw)
To: William Torrez Corea <willitc9888@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
> On Nov 26, 2022, at 3:43 PM, William Torrez Corea <willitc9888@gmail.com> wrote:
>
>
> I am using libpq: the C application programmer's interface to PostgreSQL.
>
> 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
>
> --
And do you have at hand why the loader (ld) failed?
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
@ 2022-11-26 23:17 ` William Torrez Corea <willitc9888@gmail.com>
2022-11-26 23:24 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:46 ` Re: collect2: error: ld returned 1 exit status Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 8+ messages in thread
From: William Torrez Corea @ 2022-11-26 23:17 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; +Cc: Rob Sargent <robjsargent@gmail.com>
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:
>
>
> I am using libpq: the C application programmer's interface to PostgreSQL.
>
> 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*
>>
>
> --
>
>
> 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
No package 'libpq' found
--
With kindest regards, William.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
@ 2022-11-26 23:24 ` Rob Sargent <robjsargent@gmail.com>
2022-11-27 00:51 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
1 sibling, 1 reply; 8+ messages in thread
From: Rob Sargent @ 2022-11-26 23:24 UTC (permalink / raw)
To: William Torrez Corea <willitc9888@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
--Apple-Mail-63EC68A3-3280-462A-B2BF-9CCAFE9C3163
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr"><div dir=3D"ltr"><blockquote type=3D"cite">On Nov 26=
, 2022, at 4:17 PM, William Torrez Corea <willitc9888@gmail.com> wrote=
:<br><br></blockquote></div><blockquote type=3D"cite"><div dir=3D"ltr">=EF=BB=
=BF<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote=
"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Nov 26, 2022 at 5:00 PM Rob S=
argent <<a href=3D"mailto:robjsargent@gmail.com">robjsargent@gmail.com</a=
>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px=
0px 0px 0.8ex; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><=
div dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr"><br></div><div dir=3D=
"ltr"><br><blockquote type=3D"cite">On Nov 26, 2022, at 3:43 PM, William Tor=
rez Corea <<a href=3D"mailto:willitc9888@gmail.com" target=3D"_blank">wil=
litc9888@gmail.com</a>> wrote:<br><br></blockquote></div><blockquote type=
=3D"cite"><div dir=3D"ltr">=EF=BB=BF<div dir=3D"ltr"><div>I am using libpq: t=
he C application programmer's interface to PostgreSQL. <br></div><div><=
br></div><div>Compile the code:<br></div><div><br></div><blockquote class=3D=
"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-color: rgb(204=
, 204, 204); padding-left: 1ex;"><b>sudo cc -o testprog testprog1.o testprog=
2.o -L/usr/local/pgsql/lib -lpq<br></b></blockquote><div><br></div><div>But i=
get the following error:</div><div><br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin: 0px 0px 0px 0.8ex; border-left-color: rgb(204, 204, 204=
); padding-left: 1ex;"><b>collect2: error: ld returned 1 exit status</b><br>=
</blockquote><div><br>-- </div><div><br></div></div></div></blockquote>=
</div></blockquote></div></div></div></blockquote></div><div dir=3D"ltr">And=
do you have at hand why the loader (ld) failed?</div><blockquote type=3D"ci=
te"><div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote=
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><blockquote type=3D"=
cite"><div dir=3D"ltr"><div dir=3D"ltr"><div><div dir=3D"ltr"><br></div></di=
v></div>
</div></blockquote></div></blockquote></div><br clear=3D"all">Package libpq w=
as not found in the pkg-config search path.<br>Perhaps you should add the di=
rectory containing `libpq.pc'<br>to the PKG_CONFIG_PATH environment variable=
<br>No package 'libpq' found<br><br>-- <br></div></div></blockquote><div><br=
></div>So libpq is not in <b>-L/usr/local/pgsql/lib ?</b> Do you k=
now that libpq is installed? You may need to use the Debian package in=
staller to get the =E2=80=9Cdev=E2=80=9D environment <blockquote type=3D=
"cite"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr" class=3D"gmail_sig=
nature"><br>With kindest regards, William.<br><br>=E2=A2=80=E2=A3=B4=E2=A0=BE=
=E2=A0=BB=E2=A2=B6=E2=A3=A6=E2=A0=80 <br>=E2=A3=BE=E2=A0=81=E2=A2=A0=E2=A0=92=
=E2=A0=80=E2=A3=BF=E2=A1=81 Debian - The universal operating system<br>=E2=A2=
=BF=E2=A1=84=E2=A0=98=E2=A0=B7=E2=A0=9A=E2=A0=8B=E2=A0=80 <a href=3D"https:/=
/www.debian.org" target=3D"_blank">https://www.debian.org</a><br>=E2=A0=88=E2=
=A0=B3=E2=A3=84=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80 <br><br><br></div></div>=
</div></blockquote></body></html>=
--Apple-Mail-63EC68A3-3280-462A-B2BF-9CCAFE9C3163--
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 23:24 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
@ 2022-11-27 00:51 ` William Torrez Corea <willitc9888@gmail.com>
2022-11-27 01:55 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: William Torrez Corea @ 2022-11-27 00:51 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; +Cc: Rob Sargent <robjsargent@gmail.com>
On Sat, Nov 26, 2022 at 5:25 PM Rob Sargent <robjsargent@gmail.com> wrote:
>
> On Nov 26, 2022, at 4:17 PM, William Torrez Corea <willitc9888@gmail.com>
> wrote:
>
>
>
>
> 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:
>>
>>
>> I am using libpq: the C application programmer's interface to PostgreSQL.
>>
>> 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*
>>>
>>
>> --
>>
>> 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
> No package 'libpq' found
>
> --
>
>
> So libpq is not in *-L/usr/local/pgsql/lib ?* Do you know that libpq is
> installed? You may need to use the Debian package installer to get the
> “dev” environment
>
>
> With kindest regards, William.
>
> ⢀⣴⠾⠻⢶⣦⠀
> ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
> ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
> ⠈⠳⣄⠀⠀⠀⠀
>
>
>
header files for libpq5 (PostgreSQL library), the package is broken.
--
With kindest regards, William.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 23:24 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-27 00:51 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
@ 2022-11-27 01:55 ` Rob Sargent <robjsargent@gmail.com>
2022-11-27 02:52 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Rob Sargent @ 2022-11-27 01:55 UTC (permalink / raw)
To: William Torrez Corea <willitc9888@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
--Apple-Mail-1532F360-A793-49EC-8C4C-AA022D11F473
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><blockquote type=3D"=
cite"><div dir=3D"ltr"><div dir=3D"ltr"><br clear=3D"all">header files for l=
ibpq5 (PostgreSQL library), the package is broken. <br>-- <br><div dir=3D"lt=
r" class=3D"gmail_signature"><br>With kindest regards, William.<br><br>=E2=A2=
=80=E2=A3=B4=E2=A0=BE=E2=A0=BB=E2=A2=B6=E2=A3=A6=E2=A0=80 <br>=E2=A3=BE=E2=A0=
=81=E2=A2=A0=E2=A0=92=E2=A0=80=E2=A3=BF=E2=A1=81 Debian - The universal oper=
ating system<br>=E2=A2=BF=E2=A1=84=E2=A0=98=E2=A0=B7=E2=A0=9A=E2=A0=8B=E2=A0=
=80 <a href=3D"https://www.debian.org"; target=3D"_blank">https://www.debian.=
org</a><br>=E2=A0=88=E2=A0=B3=E2=A3=84=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80 <=
br><br></div></div></div></blockquote><div><br></div>I=E2=80=99m confused. I=
s that =E2=80=98package is broken=E2=80=99 coming from dpkg. <br>=
<blockquote type=3D"cite"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"=
class=3D"gmail_signature"><br></div></div>
</div></blockquote></body></html>=
--Apple-Mail-1532F360-A793-49EC-8C4C-AA022D11F473--
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 23:24 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-27 00:51 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-27 01:55 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
@ 2022-11-27 02:52 ` William Torrez Corea <willitc9888@gmail.com>
0 siblings, 0 replies; 8+ messages in thread
From: William Torrez Corea @ 2022-11-27 02:52 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; +Cc: Rob Sargent <robjsargent@gmail.com>
On Sat, Nov 26, 2022 at 7:55 PM Rob Sargent <robjsargent@gmail.com> wrote:
>
> header files for libpq5 (PostgreSQL library), the package is broken.
> --
>
> With kindest regards, William.
>
> ⢀⣴⠾⠻⢶⣦⠀
> ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
> ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
> ⠈⠳⣄⠀⠀⠀⠀
>
>
> I’m confused. Is that ‘package is broken’ coming from dpkg.
>
>
>
The package is in Synaptic Package Manager
--
With kindest regards, William.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collect2: error: ld returned 1 exit status
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Re: collect2: error: ld returned 1 exit status Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` Re: collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
@ 2022-11-26 23:46 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 8+ messages in thread
From: Tom Lane @ 2022-11-26 23:46 UTC (permalink / raw)
To: William Torrez Corea <willitc9888@gmail.com>; +Cc: pgsql-general@lists.postgresql.org, Rob Sargent <robjsargent@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
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2022-11-27 02:52 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26 22:43 collect2: error: ld returned 1 exit status William Torrez Corea <willitc9888@gmail.com>
2022-11-26 22:59 ` Rob Sargent <robjsargent@gmail.com>
2022-11-26 23:17 ` William Torrez Corea <willitc9888@gmail.com>
2022-11-26 23:24 ` Rob Sargent <robjsargent@gmail.com>
2022-11-27 00:51 ` William Torrez Corea <willitc9888@gmail.com>
2022-11-27 01:55 ` Rob Sargent <robjsargent@gmail.com>
2022-11-27 02:52 ` William Torrez Corea <willitc9888@gmail.com>
2022-11-26 23:46 ` Tom Lane <tgl@sss.pgh.pa.us>
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