Operating System - HP-UX
1832844 Members
2827 Online
110047 Solutions
New Discussion

Re: gcc can't find system shared libraries

 
SOLVED
Go to solution
Kenneth Smith_2
New Member

gcc can't find system shared libraries

I have downloaded and installed the GCC from Merrit's web page. I am trying to compile a program with the -lpam option and it says it can't find the pam library:

gcc -o poppassd poppassd_pam.o -lpam
/opt/pa20_64/bin/../lib/gcc-lib/hppa64-hp-hpux11.11/3.3.1/../../../../hppa64-hp-
hpux11.11/bin/ld: cannot find -lpam
collect2: ld returned 1 exit status
*** Error exit code 1

I have verified that libpam.sl exsists in the /lib directory. So, I put a symbolic link to it in the /opt/pa20_64/lib directory and then it complains that it is an invalid file format:

gcc -o poppassd poppassd_pam.o -lpam
/opt/pa20_64/bin/../lib/gcc-lib/hppa64-hp-hpux11.11/3.3.1/../../../libpam.sl: fi
le not recognized: File format not recognized
collect2: ld returned 1 exit status

How can I get GCC to recognize and use the libraries in the /lib directory? Below is the configuration of the GCC:

eading specs from /opt/pa20_64/bin/../lib/gcc-lib/hppa64-hp-hpux11.11/3.3.1/spe
cs
Configured with: ../src/configure --enable-languages=c,c++ --prefix=/usr/local/p
a20_64 --with-local-prefix=/usr/local/pa20_64 --with-gnu-as --with-as=/usr/local
/pa20_64/bin/as --with-gnu-ld --with-ld=/usr/local/pa20_64/bin/ld --disable-shar
ed --disable-nls --host=hppa64-hp-hpux11.11
Thread model: single
gcc version 3.3.1
5 REPLIES 5
Kenneth Smith_2
New Member

Re: gcc can't find system shared libraries

I forgot to mention that this is on HPUX 11i running in 64 bit mode.
Ermin Borovac
Honored Contributor

Re: gcc can't find system shared libraries

Your 64-bit gcc is looking for 64-bit libraries, which are located in /lib/pa20_64 directory. It seems that there is no 64-bit libpam. So it looks like you'll have to get 32-bit gcc and compile your app with it.
Kenneth Smith_2
New Member

Re: gcc can't find system shared libraries

Do you if it is possible to have both the 32 bit and 64 bit versions of GCC installed on the machine and use which ever is appropriate for the task?

Thanks,

Ken
Ermin Borovac
Honored Contributor

Re: gcc can't find system shared libraries

Yes, it is possible to have both 32-bit and 64-bit. Of course they need to be installed in different directories.
H.Merijn Brand (procura
Honored Contributor
Solution

Re: gcc can't find system shared libraries

Do you mean "Merijn", instead of "Merrit"?

Yes you can install them next to eachother, which it does by default: /usr/local/pa20_64 for the 64bit environment, and /usr/local/pa20_32 for the 32bit environment. It *needs* those path's. You can install them anywhere you want, but then you will have to symlink those other flders to be available from /usr/local

When calling either be sure to have the $PATH have the wanted arch in front. I've made it easier for you by making the 64bit GNU gcc available as gcc64, so you can add both pa20_32 and pa20_64 in your $PATH (in that order) and still use both at the same time.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn