GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Issue in Loading Shared Object.
Operating System - HP-UX
1844185
Members
2485
Online
110229
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2004 12:31 PM
10-26-2004 12:31 PM
Hi All,
I am new to HP Unix and need some help. I created a Shared Object. I have an executable that loads the Shared Object and calls a function from with in the Shared Object. The Shared Object gets loaded and the functon gets called. I know because i am printing some information with in the function.
This works fine till the time the Shared Object and the executable are in the same directory. As soon as i try to load this Shared Object from any other directory dlopen() fails and dlerror() returns " Can't Open Shared Library ".
I have include the SO path in the environment variables LD_LIBRARY_PATH and SHLIB_PATH.
I am compiling the SO as follows
cc +z filename.c this gives me filename.o
/usr/bin/ld -b -lc -lm -o filename.o
This gives me the Shared Object.
Is there any other option that i need to give ?
Thanks and Regards,
Saurav.
I am new to HP Unix and need some help. I created a Shared Object. I have an executable that loads the Shared Object and calls a function from with in the Shared Object. The Shared Object gets loaded and the functon gets called. I know because i am printing some information with in the function.
This works fine till the time the Shared Object and the executable are in the same directory. As soon as i try to load this Shared Object from any other directory dlopen() fails and dlerror() returns " Can't Open Shared Library ".
I have include the SO path in the environment variables LD_LIBRARY_PATH and SHLIB_PATH.
I am compiling the SO as follows
cc +z filename.c this gives me filename.o
/usr/bin/ld -b -lc -lm -o
This gives me the Shared Object.
Is there any other option that i need to give ?
Thanks and Regards,
Saurav.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2004 01:01 PM
10-26-2004 01:01 PM
Solution
HP-UX needs to have the SHLIB_PATH variable set.
SHLIB_PATH=usr/bin
export SHLIB_PATH
if its already set (check with echo)
SHLIB_PATH=usr/bin:$SHLIB_PATH
export SHLIB_PATH
All set.
SEP
SHLIB_PATH=usr/bin
export SHLIB_PATH
if its already set (check with echo)
SHLIB_PATH=usr/bin:$SHLIB_PATH
export SHLIB_PATH
All set.
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
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2004 03:57 PM
10-26-2004 03:57 PM
Re: Issue in Loading Shared Object.
Check your executable (that loads the shared library) with chatr to see if use of SHLIB_PATH is enabled or disabled.
$ /usr/bin/chatr
If you see the following line in the output you can't use SHLIB_PATH to tell your executable where the shared library is.
SHLIB_PATH disabled second
Run the following command to enable use of SHLIB_PATH.
$ /usr/bin/chatr +s enable
If you want SHLIB_PATH to be enabled automatically, compile your executable with -Wl,+s option.
$ cc -Wl,+s test.c -o test
$ /usr/bin/chatr
If you see the following line in the output you can't use SHLIB_PATH to tell your executable where the shared library is.
SHLIB_PATH disabled second
Run the following command to enable use of SHLIB_PATH.
$ /usr/bin/chatr +s enable
If you want SHLIB_PATH to be enabled automatically, compile your executable with -Wl,+s option.
$ cc -Wl,+s test.c -o test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2004 09:03 AM
10-27-2004 09:03 AM
Re: Issue in Loading Shared Object.
Thank you.
Regards,
Saurav.
Regards,
Saurav.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP