1827491 Members
2373 Online
109965 Solutions
New Discussion

Can't find library: "dl"

 
SOLVED
Go to solution

Can't find library: "dl"

I'm trying to compile GhostPCL on my server running HP-UX 11.11. I have install GNU Make 3.80, GCC 3.4.3, gettext 0.14.1, libiconv 1.9.2, and X11 development kit (B3394BA). I finally got rid on all errors except for one:
/usr/ccs/bin/ld: Can't find library: "dl"
collect2: ld returned 1 exit status
gmake: *** [obj/pcl6] Error 1
gmake: Leaving directory `/opt/ghostpcl_1.41/main'
*** Error exit code 2

Stop.

If I change the make file from
STDLIBS=-lm -lpthread -ldl
to
STDLIBS=-lm -lpthread

It will compile without any errors. Where can I find and/or get the dl library?

Thank you.
3 REPLIES 3
Ermin Borovac
Honored Contributor
Solution

Re: Can't find library: "dl"

libdl (dynamic loader API library) is available for 64-bit builds and it can be found in /usr/lib/pa20_64 directory.

-r-xr-xr-x 1 bin bin 15048 Jan 27 2005 libdl.1
lrwxr-xr-x 1 root sys 9 Apr 18 2002 libdl.sl -> ./libdl.1
lrwxr-xr-x 1 root sys 9 Apr 18 2002 libdld.1 -> ./libdl.1
lrwxr-xr-x 1 root sys 10 Apr 18 2002 libdld.sl -> ./libdld.1

As you can see libdld.1 is symbolic link to libdl.1.

libdl is usually linked when dlopen() and friends are required. These functions are also found in 32-bit libdld.

libdl (for 64-bit builds) or libdld (for 32-bit builds) is automatically linked with every binary so I don't think you need to do anything.

Vibhor Kumar Agarwal
Esteemed Contributor

Re: Can't find library: "dl"

If somehow that path is not in your makefile:

Append it either by -L or in LD_LIBRARY_PATH
Vibhor Kumar Agarwal

Re: Can't find library: "dl"

That did it.

Thanks.