Operating System - HP-UX
1748265 Members
4003 Online
108760 Solutions
New Discussion

Error message when attempting to test gcc

 
SOLVED
Go to solution
mr_s29
Advisor

Error message when attempting to test gcc

Hi,

 

I added gcc 2.95.3 to an HP-UX 10.20 32-bit machine ( I do realize that HP-UX 10.20 is old but we need to keep this system because of some clients).  I created a hello.c test file in my /test directory.  I then attempted to test the gcc with the following command:  gcc /test/hello.c -o /test/hello.exe

 

The error message below was output:

/usr/ccs/bin/ld:  Can't find library for -lgcc

 

I am not sure how to resolve this issue.  Any help would be appreciated.  Thanks.

4 REPLIES 4
Dennis Handly
Acclaimed Contributor
Solution

Re: Error message when attempting to test gcc

>I am not sure how to resolve this issue.

 

When was the last time this worked?  It seems you are missing libgcc.*.

mr_s29
Advisor

Re: Error message when attempting to test gcc

Hi Dennis

 

Thanks for replying.

 

To answer your question, I just installed the both the OS and gcc on this machine a few weeks ago so gcc has never worked on this machine before.

 

I do have libgcc.a under /usr/pa20_32/lib.  I tried adding both /usr/pa20_32/lib and /usr/pa20_32/lib/libgcc.a to /etc/PATH.  I then tried testing gcc again but got the same error.

 

Thanks.

mr_s29
Advisor

Re: Error message when attempting to test gcc

Hi Dennis,

 

I was able to solve this issue by creating the following symbolic link:

 

ln -s /usr/pa20_32/lib/libgcc.a /usr/lib/libgcc.a

 

Thanks for the advice on missing the libgcc.

Dennis Handly
Acclaimed Contributor

Re: Error message when attempting to test gcc

>/etc/PATH

 

This contains paths to binaries, not libs.  ld(1) uses LPATH for that.  Or add -L path on the link line.

 

>by creating the following symbolic link:  ln -s /usr/pa20_32/lib/libgcc.a

 

That's strange, I thought /usr/pa20_32/lib/ would only be for HP products and for performance, not gcc.