1821984 Members
3361 Online
109638 Solutions
New Discussion юеВ

dlopen not working

 
Rajkumar Iyer
New Member

dlopen not working

I am trying the following code on HP-UX ...


#include
#include
#include

int main()
{
void *libhandle;
libhandle= dlopen("templib.1.sl",RTLD_LAZY|RTLD_GLOBAL);
if(libhandle == NULL)
printf("There is a problem %s\n",dlerror());
else
printf("everything went fine \n");
return 1;
}


I have set the SHLIB_PATH properly to point to the location where the library file exist but still dlopen call is failing.

The error message I get is "Can't open shared library: templib.1.sl"

What could be the possible reasons for this behavior.

The system specification is "HP-UX ccs-hp1 B.11.11 U 9000/800" I am using native compiler for creating the binary.

Raj
3 REPLIES 3
Senthil Prabu.S_1
Trusted Contributor

Re: dlopen not working

Hi Raj,
HPUX doesnot support dlopen call, it supports sh_load call. So this code will not work on HP-UX os, so try it on Linux


HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Rajkumar Iyer
New Member

Re: dlopen not working

Hi Prabu,

I tried with the shl_load also it is still failing.

And FYI dlopen is now supported on HP-UX. have a look at following link http://docs.hp.com/en/B2355-90694/dlopen.3C.html

Thanks for you interest

Regards
Raj
Rajkumar Iyer
New Member

Re: dlopen not working

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=72934

Please follow the link for the solution. For the HP-UX +s option has to be passed with linker to enable looking for libraries in SHLIB_PATH.

Regards
Raj