Operating System - HP-UX
1833912 Members
8417 Online
110063 Solutions
New Discussion

Re: how to make the libdl.sl library available to ld

 
Patrice Bedard
New Member

how to make the libdl.sl library available to ld

Hi,
I'm trying to build an application on HP-UX but I have problems at the linking step:

libc.2
-n Checking glibc subversion...
gcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\"0.6.2\" installwatch.c
ld -shared -o installwatch.sl installwatch.o -ldl -ldld -lc
ld: Can't find library for -ldl
*** Error exit code 1

Anyone can help me ?

Thanks in advance,

Pat
9 REPLIES 9
Mike Stroyan
Honored Contributor

Re: how to make the libdl.sl library available to ld

The only libdl.sl on HP-UX 11.00 and 11.11 is for 64-bit code. dlopen and related functions found in the 64-bit libdl.sl are available in up to date patches of the 32-bit libc.sl.
Patrice Bedard
New Member

Re: how to make the libdl.sl library available to ld

Thanks for your reply. So youb are suggesting that I install the necessary patchs for the 32bits version of libc ? right ?

Or are you suggesting that if I try to compile the application wat 64bits it would work without patching ?

Thanks in advance for your precision.

Pat
Mike Stroyan
Honored Contributor

Re: how to make the libdl.sl library available to ld

I misspoke in saying libc. The dlopen function is in libdld for 32-bit. The current patch with dlopen in that library is PHSS_28434. The first
patch with that in was back in May of 2000. There are plenty of reasons to have at least that new of a linker and loader patch. The current patch is available from
http://www2.itrc.hp.com/service/patch/patchDetail.do?patchid=PHSS_28434

I would favor using 32-bit libdld and a new enough patch level. If you had some other reason to switch to 64-bit mode, then you would use libdl. If you don't want to require any patches on 11.00 you could also chose to change the code to use the shl_load function and related functions instead of dlopen.
Patrice Bedard
New Member

Re: how to make the libdl.sl library available to ld

Again, thanks for your help.

I'm trying to install the patch you refered me too and it seems like this patch isn't for 11i. I haven't found other patches specific to HP-UX 11.11 .Here is the log:

[qcashp02@root]: swinstall -s /tmp/LDDpatch/depot PHSS_28434

======= 07/09/03 09:31:00 EDT BEGIN swinstall SESSION
(non-interactive) (jobid=qcashp02-0019)

* Session started for user "root@qcashp02".

* Beginning Selection
* Target connection succeeded for "qcashp02:/".
* Source connection succeeded for
"qcashp02:/tmp/LDDpatch/depot".
ERROR: Could not apply the software selection "PHSS_28434" because
there are no product variations that are compatible with the
destination host(s).
* Software selection failed for "qcashp02:/tmp/LDDpatch/depot".
ERROR: No software has been selected.
ERROR: Cannot continue the "swinstall" task.
* Selection had errors.



======= 07/09/03 09:31:02 EDT END swinstall SESSION (non-interactive)
(jobid=qcashp02-0019)

Thanks for you help!

Pat
Manuel Plaza
Regular Advisor

Re: how to make the libdl.sl library available to ld

Hi Pat,

We have /usr/lib/libdld.sl linked to /usr/lib/libdld.2

Regards,

Manuel
Patrice Bedard
New Member

Re: how to make the libdl.sl library available to ld

Hi,
we have it too. But the linker is still complaining, maybe I'm just using the wrong linker options ??

Pat
Manuel Plaza
Regular Advisor

Re: how to make the libdl.sl library available to ld

And, have you correctly defined the "SHLIB_PATH" variable ?

Regards,

Manuel
Mehdi_1
Regular Advisor

Re: how to make the libdl.sl library available to ld

Hi Pat

What system have you got?

in my IA64 platform they are inside:

/usr/lib/hpux32/libdl.so
/usr/lib/pa20_64/libdl.sl
/usr/lib/hpux64/libdl.so


__Mehdi
Mike Stroyan
Honored Contributor

Re: how to make the libdl.sl library available to ld

The most recent linker tools patch for 11.11 is PHSS_26560. You say the linker is complaining, but it is not clear which complaint it makes. Have you removed '-ldl' from the link line, as you should for a 32-bit link?
Is ld complaining about missing symbols?