/usr/bin/ld: Unsatisfied Symbols: dlopen (code)..

On HPUX 11.0 I'm trying to compile and link an application that contains calls to dlopen, dlclose, dlerror and dlsym using gcc.  I receive the following error:

/usr/bin/ld:  Unsatisfied Symbols:
   dlerror (code)
   dlopen (code)
   dlclose (code)
   dlsym (code)

Can anyone tell me what switches are required to resolve the externals?  I've tried using -ldl and -ldld.

Thank you
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AFAIK the subroutines are names sh_open(), sh_sym(), sh_free()
My man page for dlerror says to add -ldl to the compile command. If this does not work for you, I would try to locate
libdl.sl on your file system (/usr/lib?) and make sure your SHLIB_PATH variable points to that directory. Alternatively, you can specify the directory on the compiler command line using the -L <path> option.

HPUX doesn't support dlxxx() API. You should
use shl_load()/shl_findsym()/etc. to implement
them (or use a third party wrapper). The linking
option to use shl_xxx() is -ldld.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

treewolfAuthor Commented:
Help me understand, if HPUX 11.0 doesn't support dlopen ... why does it include a man page and the appropriate header file dlfcn.h?

Thank you.
shl_load() ??
has it changed in 10.xx, in 9.x it was shl_open()
Answer to freewolf's Tuesday question:

Looks like they are going to provide a wrapper
in later release or they were decide to do so
before 11 and dropped the idea but forgot
to remove the include file. Anyway, I searched
all .sl, .o and .a file in my 11 box and couldn;t
find any of them defines dlopen etc..

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
To ahoffmann's Tuesday question:

Check your manual. It is always shl_load() including 9.x. I only know one variant in 9.x. To support C++ global constructor/destructor,  one should use xxshl_load()/xxshl_unload(). This has already been integrated into shl_load/unload since 10.x
kejin, thanks for the additional info
treewolfAuthor Commented:
Thank you for your help.  How did you search the libraries for the dlopen reference, maybe I can try it on my machines?

Thank you again.
for f in /usr/lib/*.sl /usr/lib/*.o ....
echo $f
nm $f | grep dlopen

Sorry, I am not good at shell programming,
this is only a pseudo shell script.
looks good, this pseudo shell ;-)
just would add -gop options to nm (not shure if HP supports -g, but does -o and -p) and then | grep T
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.