Re: Error message when attempting to test gcc (353 Views)
Reply
Advisor
mr_s29
Posts: 13
Registered: ‎06-12-2012
Message 1 of 5 (412 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.

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,898
Registered: ‎03-06-2006
Message 2 of 5 (405 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.*.

Please use plain text.
Advisor
mr_s29
Posts: 13
Registered: ‎06-12-2012
Message 3 of 5 (375 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.

Please use plain text.
Advisor
mr_s29
Posts: 13
Registered: ‎06-12-2012
Message 4 of 5 (367 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.

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,898
Registered: ‎03-06-2006
Message 5 of 5 (353 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.

Please use plain text.
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