Operating System - HP-UX
1755960 Members
4510 Online
108839 Solutions
New Discussion юеВ

Unable to build a shared library on HP-UX 11.22

 
SOLVED
Go to solution
sachin myneni
Advisor

Unable to build a shared library on HP-UX 11.22

Hello,

I am trying to port my shared library to HP-UX 11.22 running on Itanium2. The linker is unable to find the libraries that I build *and* have in the correct place!
I seem to have the correct link line :)


......................................................
Linking executable nu80d_HP-UX_42_ia64.sl
/opt/aCC/bin/aCC +Oopenmp +DD64 +DSitanium2 +U77 -b *.o +O3 -Wl,-ashared -Wl,-L/a/homes/myneni/nu_libs -Wl,-L/a/homes/OSLIBS/LIB-HP-UX -lnumerflib_HP-UX_ia64 -lnumerclib_HP-UX_ia64 -lbcslib42_HP-UX_ia64 -lmetis_11_ia64 -Wl,-L/opt/mlib/lib/hpux64 -lblas_HP-UX_ia64 -Wl,-L/usr/lib/hpux64 -lIO77 -lF90 -lU77 -lstream -o nu80d_HP-UX_42_ia64.sl
ld: Can't find library or mismatched ABI for -lnumerflib_HP-UX_ia64
Fatal error.
make: *** [link_HP-UX_ia64] Error 1
myneni@hp73 p4_mdl/mbd >

The library libnumerflib_HP-UX_ia64.a does exist in 'nu_libs' so I am not sure why ld doesn't find it. I also tried not having -Wl, ahead of each -L/path/...but that didn't help either.

The objects in libnumerflib_HP-UX_ia64.a are of the following type:
y12mdf.o: ELF-64 relocatable object file - IA64

Any help is most appreciated.

-Sachin
3 REPLIES 3
Ermin Borovac
Honored Contributor
Solution

Re: Unable to build a shared library on HP-UX 11.22

You are compiling with '-Wl,-ashared', thus linker only searches for shared libraries and you have archive library (.a).

Amit Agarwal_1
Trusted Contributor

Re: Unable to build a shared library on HP-UX 11.22

As said by Ermin using -Wl,-ashared forces search for shared library only. Replace it with -Wl,-ashared_archive, to search in shared libraries and then on failure search in archive libraries.

man ld...for more information

-Amit
sachin myneni
Advisor

Re: Unable to build a shared library on HP-UX 11.22

Ermin and Amit. Thanks!