Operating System - HP-UX
1751974 Members
4875 Online
108784 Solutions
New Discussion юеВ

Compile error: ld: Can't find library for -lc

 
SOLVED
Go to solution
dictum9
Super Advisor

Compile error: ld: Can't find library for -lc

Trying to compile with gcc and get this:

ld: Can't find library for -lc
Fatal error.
collect2: ld returned 1 exit status
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.


I did ran configure to point to the right libraries, to no avail.

#: ./configure -libdir /usr/lib/pa20_64

4 REPLIES 4
Steven Schweda
Honored Contributor
Solution

Re: Compile error: ld: Can't find library for -lc

> Trying to compile with gcc and get this:
> [...]

Trying to "compile" _what_, exactly? How,
exactly? On what? Using what?

Potentially interesting (after some less
fact-free description of what you're doing):

uname -a
gcc -V

As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions and interpretations. Hint:
"Trying to compile" is not a very useful
description of what you did.


> ld: Can't find library for -lc

With my weak psychic powers, I can't see tha
actual command which led to that message, but
my first guess is that the product which
you're trying to build may be portable across
a few UNIX-like systems, but that HP-UX is
not one of them. The (invisible) "configure"
script and/or the (invisible) "make" file may
need some work.


> I did ran configure to point to the right
> libraries, to no avail.

Hint: "to no avail" is not a very useful
description of what happened when you did
that.
dictum9
Super Advisor

Re: Compile error: ld: Can't find library for -lc

Trying to compile curses 5.7 using gcc 4.2.3 on hp-ux 11.23.

Steven Schweda
Honored Contributor

Re: Compile error: ld: Can't find library for -lc

> Trying to compile curses 5.7 using gcc
> 4.2.3 on hp-ux 11.23.

Do you mean GNU ncurses 5.7? As at:
http://ftp.gnu.org/gnu/ncurses/
?

Looks like a mystery. Around here:

dyi # uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license

dyi # gcc -v
Using built-in specs.
Target: ia64-hp-hpux11.31
Configured with: ../gcc-4.3.3/configure
Thread model: posix
gcc version 4.3.3 (GCC)

./configure
gmake

And it dies so:

[...]
gcc ../objects/tic.o ../objects/dump_entry.o -I../progs -I. -DHAVE_CONFIG_H -I. -I../include -D_HPUX_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -I/usr/local/include/ncurses -O2 --param max-inline-insns-single=1200 -static -L../lib -lncurses -L../lib -lncurses -dynamic -o tic
ld: Can't find library for -lunwind
Fatal error.
collect2: ld returned 1 exit status
gmake[1]: *** [tic] Error 1
gmake[1]: Leaving directory `/usr/local/gnu/ncurses/ncurses-5.7/progs'
gmake: *** [all] Error 2


I don't see any (explicit) "-lunwind", so I'm
lost. Perhaps someone else has solved this
puzzle already.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/ncurses-5.7/
Dennis Handly
Acclaimed Contributor

Re: Compile error: ld: Can't find library for -lc

>ld: Can't find library for -lc

This will occur on Integrity if you use gcc's -static. There are no archive versions of libc and libunwind, etc.

>./configure -libdir /usr/lib/pa20_64

This is a PA64 path and also not likely to be valid for Integrity. You could try /usr/lib/hpux32 or /usr/lib/hpux64