Operating System - HP-UX
1836356 Members
2013 Online
110100 Solutions
New Discussion

/usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

 
SOLVED
Go to solution
Amit Basnak
Occasional Advisor

/usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Dear friends

We are in the process of creating the new server binary for Systinet Server for C++ . We have compiled the demo folder with the command /opt/systinet/server_cpp65/share/doc/waspc/demos> ./configure CXX=/opt/aCC/bin/aCC LD=/opt/aCC/bin/aCC

and it was successul and I used aCC compiler as the linker instead of system default (/usr/ccs/bin/ld) now doing make Im getting the following error
$ make all
No suffix list.
Making all in basic
No suffix list.
Making all in arrays
cd ../.. && make am--refresh
No suffix list.
No suffix list.
/bin/sh ../../libtool --mode=link /opt/aCC/bin/aCC -g -o
arrays client.o arrays.lo arraysStructs.lo
/opt/systinet/server_cpp65/lib/libwasp.la
/opt/systinet/server_cpp65/lib/libwasp_stl.la
/opt/aCC/bin/aCC -g -o arrays client.o .libs/arrays.o
.libs/arraysStructs.o /opt/systinet/server_cpp65/lib/libwasp_stl.sl
/opt/systinet/server_cpp65/lib/libwasp.sl -lm -ldl -lpthread -Wl,+b
-Wl,/opt/systinet/server_cpp65/lib -Wl,+s
/usr/ccs/bin/ld: Can't find library: "dl"
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.

I do have the said library at: /usr/lib/pa20_64/libdl.1
but adding it to the Make file did not work.
also having specified aCC compiler as linker while running ./configure , the error shows still is uses system default linker /usr/ccs/bin/ld. Im not sure why .

All the 64 bit libraries of HP-UX are under /usr/lib/pa20_64 directory .

Any idea How do I get rid of the error ??

Thanks for your time

Amit
8 REPLIES 8
Fabio Ettore
Honored Contributor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Hi Amit,

you wrote that "dl" library is into /usr/lib/pa20_64/libdl.1. Are you sure that dl library is for 64bit? If it's a 32bit library then you have to put it into /usr/lib:

============
The Default Library Search Path

By default, ld searches for libraries in the directory /usr/lib/hpux32 for 32-bit executables and /usr/lib/hpux64 for 64-bit executables.

(1)
/usr/lib/ (for PA32)
/usr/lib/pa20_64/ (for PA64)
/usr/lib/hpux32/ (for IPF 32-bit)
/usr/lib/hpux64/ (for IPF 64-bit)
============

Check by

file libdl.1

either it's 64bit. If it's a 32bit library try to put "dl" library into /usr/lib and run again make.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Steven E. Protter
Exalted Contributor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Shalom,

Is the effected library on the SHLIB_PATH ?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Amit Basnak
Occasional Advisor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Fabio thanks for the reply

I didnt get when you wrote

it's 64bit. If it's a 32bit library try to put "dl" library into /usr/lib and run again make.


You mean to say to copy the respective file to /usr/lib ?

well we are using 64 bit HP-UX system. I reckon its in /usr/lib/pa20_64

Also When I mentioned my linker from /opt/aCC/bin/aCC
why the default linker /ld is used Idont understand

Thanks
Amit
Dennis Handly
Acclaimed Contributor
Solution

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

For PA32, you should link with -ldld, not -ldl. For PA64 and IPF there is a libdl.

>the error shows still is uses system default linker /usr/ccs/bin/ld. Im not sure why

Because aCC is a driver, not a linker but eventually invokes ld.

>You mean to say to copy the respective file to /usr/lib?

No! Don't do that.

>well we are using 64 bit HP-UX system.

All this means is that you could create 64 bit applications but you didn't.
So, you should change your makefile to replace -ldl by -ldld.

>Steven: Is the effected library on the SHLIB_PATH?

Since this a linker error, SHLIB_PATH has no affect.
Amit Basnak
Occasional Advisor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Thanks Denis, Steven and Fabio

I did a grep for ldl and here is what I have
here are the files that contains ldl


$ find ./ -exec grep -l ldl {} \;
./.sh_history
./systinet/server_cpp65/lib/libwasp.la
./systinet/server_cpp65/lib/libwasp_wsdl.la
./systinet/server_cpp65/lib/libwasp_dii.la
./systinet/server_cpp65/lib/libwasp_security.la
./systinet/server_cpp65/lib/libwasp_stl.la
./systinet/server_cpp65/lib/libwasp_validator.la
./systinet/server_cpp65/lib/mod_13_wasp.la
./systinet/server_cpp65/lib/mod_wasp.la
./systinet/server_cpp65/share/waspc/src/STLSupport/aclocal.m4
./systinet/server_cpp65/share/waspc/src/STLSupport/configure
./systinet/server_cpp65/share/waspc/src/STLSupport/config.guess
./systinet/server_cpp65/share/waspc/src/STLSupport/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/basic/arrays/.libs/libwaspdem­o_arrays.la
./systinet/server_cpp65/share/doc/waspc/demos/basic/arrays/libwaspdemo_arra­ys.la
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/aclocal.m4
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/configure
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/config.guess
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v2/library/libtool
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/aclocal.m4
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/configure
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/config.guess
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/uddi/v3/library/libtool
./systinet/server_cpp65/share/doc/waspc/demos/aclocal.m4
./systinet/server_cpp65/share/doc/waspc/demos/configure
./systinet/server_cpp65/share/doc/waspc/demos/config.guess
./systinet/server_cpp65/share/doc/waspc/demos/ltmain.sh
./systinet/server_cpp65/share/doc/waspc/demos/libtool
./systinet/server_cpp65/share/doc/waspc/doc/waspc/html/js/searchData.js
./systinet/server_cpp65/include/waspc/config/configAuto.h

So there is no Makefile yet which has ldl in it.
Also the configure file which is used to build Makefile has the following

# if libdl is installed we need to link against it
echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"

if test $ac_cv_lib_dl_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else


lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes


fi
---------------------------------------------------------------------------­------------------------------------------------


For -ldld


if test $ac_cv_lib_svld_dlopen = yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
if test "${ac_cv_lib_dld_dld_link+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-------------------------------------------
Also if I configure al over again like

CXX=/opt/aCC/bin/aCC LD=/opt/aCC/bin/aCC -L /usr/lib/pa20_64 -ldld

the files in my /usr/lib/pa20_64 directory are
libdl.1
libdl.sl
libdld.1
libdld.sl

there is no libdl.a file in pa20_64

Thanks for all your help and time
Amit
Dennis Handly
Acclaimed Contributor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

>Also the configure file which is used to build Makefile has the following
# if libdl is installed we need to link against it

This needs to check for libdld.

>CXX=/opt/aCC/bin/aCC LD=/opt/aCC/bin/aCC -L/usr/lib/pa20_64 -ldld

You should NOT use pa20_64 if you are making a 32 bit application.

>there is no libdl.a file in pa20_64

This libdld and libdl only come in a shared lib form.
Amit Basnak
Occasional Advisor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Dennis

Thanks again for your time. I was going through the documentation for the Systinet Server for C++ and realized that Systinet OpenSSL binary is needed as Systinet Server for C++ for HP-UX is compiled against these binaries.

I looked for the OpenSSL binary distribution i.e openssl-0.9.7e for HP-UX but could't find one. On openssl.org thay have source distribuation not the binary distributions and source distribution wont work on systinet Binary distribution .
Any idea where I could find openSSL binary for HP-UX ?

Thanks a lot for the time and your expert comments.

best regards
Amit


Amit Basnak
Occasional Advisor

Re: /usr/ccs/bin/ld: Can't find library: "dl" on HP-UX

Thanks Guys for the help