Operating System - HP-UX
1834484 Members
3901 Online
110067 Solutions
New Discussion

Re: gcc libraries being picked up from the wrong location

 
SOLVED
Go to solution
Sonison James
Frequent Advisor

gcc libraries being picked up from the wrong location

Hello,

I had built an application using gcc 3.2 on one machine. When I try to run the application from another machine which does not have gcc installed on it, it looks for the libraries libgcc_s.sl and libstdc++.sl in /usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.2/../../../

Any help on this problem would be highly appreciated.

Thanks and regards
Sonison James
3 REPLIES 3
Adam J Markiewicz
Trusted Contributor

Re: gcc libraries being picked up from the wrong location

How about installing gcc, or at least all the required libraries, on that other machine?

Good luck
Adam
I do everything perfectly, except from my mistakes
Steven Gillard_2
Honored Contributor
Solution

Re: gcc libraries being picked up from the wrong location

Alternatively, build your executable with static (archive) libraries by using the -static or -static-libgcc compiler flags. This will embed the required libraries within the executable resulting in a larger file files. Otherwise you'll have to install the shared libraries on the target system as Adam suggests.

If the libraries are installed in a different location on the target system, set the SHLIB_PATH environment variable before running the program. You may need to run "chatr +s enable " first to enable SHLIB_PATH lookup.

Regards,
Steve
Sonison James
Frequent Advisor

Re: gcc libraries being picked up from the wrong location

Hello,

Steven thanks for the info, using chatr solved my problem.

Thanks and regards
Sonison James