Re: Error message when attempting to test gcc (449 Views)
Reply
Advisor
mr_s29
Posts: 13
Registered: ‎06-12-2012
Message 1 of 5 (508 Views)
Accepted Solution

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.

Acclaimed Contributor
Dennis Handly
Posts: 25,276
Registered: ‎03-06-2006
Message 2 of 5 (501 Views)

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.*.

Advisor
mr_s29
Posts: 13
Registered: ‎06-12-2012
Message 3 of 5 (471 Views)

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.

Advisor
mr_s29
Posts: 13
Registered: ‎06-12-2012
Message 4 of 5 (463 Views)

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.

Acclaimed Contributor
Dennis Handly
Posts: 25,276
Registered: ‎03-06-2006
Message 5 of 5 (449 Views)

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.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.