HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Getting error while linking shared library
Operating System - HP-UX
1826663
Members
2838
Online
109695
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
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
11-16-2000 07:52 AM
11-16-2000 07:52 AM
Getting error while linking shared library
Hi
I am using aCC 3.1.5 compiler on HPUX 11.0.
One of my executable DbInit uses Oracle 8.1.5 shared library libclntsh.sl.
It was comipled & linked as follows:
COMPILE : aCC -DDEBUG -ext +W 641,684,829 -z -D_UNIX_ -D__hpux +DAportable -g +objdebug +Z -D_REENTRANT -D_KERNEL_THREADS -D_THREAD_SAFE -I. -I/vobs/hp11/Visigenic/vbroker/include -I/vobs/hp11/Oracle/rdbms/demo -I/vobs/hp11/Oracle/plsql/public -I/vobs/hp11/Oracle/network/public -c DbInit.cpp
LINK : aCC -g -Wl,-B,immediate -Wl,+s -o DbInit DbInit.o -L/vobs/hp11/Oracle/lib -lclntsh -L/vobs/hp11/Visigenic/vbroker/lib -lorb_r -lpthread
The above oracle path is different at the client side.
I am keeping all oracle libraries in /opt/Oracle/lib direcory at the client side. So I am setting SHLIB_PATH & LD_LIBRARY_PATH to that directory. At the client side I don't have /vobs/bldenv/hp11/Oracle/lib directory, When I try to run DbInit executable I am getting following errors.
/usr/lib/dld.sl: Can't open shared library: /vobs/bldenv/hp11/Oracle/lib/libclntsh.sl.8.0
/usr/lib/dld.sl: No such file or directory
Que :
1> For Shared libraries, can I use different LD_LIBRARY_PATH/SHLIB_PATH different from path used while linking?
2> Whether I specified any wrong aCC compilation/Linking option?
3> For above scenario is there any way out.
-Pravin
I am using aCC 3.1.5 compiler on HPUX 11.0.
One of my executable DbInit uses Oracle 8.1.5 shared library libclntsh.sl.
It was comipled & linked as follows:
COMPILE : aCC -DDEBUG -ext +W 641,684,829 -z -D_UNIX_ -D__hpux +DAportable -g +objdebug +Z -D_REENTRANT -D_KERNEL_THREADS -D_THREAD_SAFE -I. -I/vobs/hp11/Visigenic/vbroker/include -I/vobs/hp11/Oracle/rdbms/demo -I/vobs/hp11/Oracle/plsql/public -I/vobs/hp11/Oracle/network/public -c DbInit.cpp
LINK : aCC -g -Wl,-B,immediate -Wl,+s -o DbInit DbInit.o -L/vobs/hp11/Oracle/lib -lclntsh -L/vobs/hp11/Visigenic/vbroker/lib -lorb_r -lpthread
The above oracle path is different at the client side.
I am keeping all oracle libraries in /opt/Oracle/lib direcory at the client side. So I am setting SHLIB_PATH & LD_LIBRARY_PATH to that directory. At the client side I don't have /vobs/bldenv/hp11/Oracle/lib directory, When I try to run DbInit executable I am getting following errors.
/usr/lib/dld.sl: Can't open shared library: /vobs/bldenv/hp11/Oracle/lib/libclntsh.sl.8.0
/usr/lib/dld.sl: No such file or directory
Que :
1> For Shared libraries, can I use different LD_LIBRARY_PATH/SHLIB_PATH different from path used while linking?
2> Whether I specified any wrong aCC compilation/Linking option?
3> For above scenario is there any way out.
-Pravin
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 10:39 AM
11-16-2000 10:39 AM
Re: Getting error while linking shared library
You can change the recorded path for a shared library using the +cdp option of ld. In your current case you would add
+Wl,+cdp,/vobs/bldenv/hp11/Oracle/lib:/opt/Oracle/lib
to replace the link directory with the appropriate runtime directory.
There is another apparent problem with the basename of the library. You linked with -lclntsh but the runtime reference was to libclntsh.sl.8.0. The name with the trailing 8.0 could have come from either an internal name of the library or a symbolic link to a different file. A simple ll of the shared library will show if it is a symbolic link. If you use the chatr command on a shared library it will show if it has an internal name. The internal name can be set by using the ld +h option when creating a shared library. If an internal name is set, it will be remembered instead of the actual file name at link time. If the internal name starts with / it will be used as the full remembered path instead of the actual path at link time.
+Wl,+cdp,/vobs/bldenv/hp11/Oracle/lib:/opt/Oracle/lib
to replace the link directory with the appropriate runtime directory.
There is another apparent problem with the basename of the library. You linked with -lclntsh but the runtime reference was to libclntsh.sl.8.0. The name with the trailing 8.0 could have come from either an internal name of the library or a symbolic link to a different file. A simple ll of the shared library will show if it is a symbolic link. If you use the chatr command on a shared library it will show if it has an internal name. The internal name can be set by using the ld +h option when creating a shared library. If an internal name is set, it will be remembered instead of the actual file name at link time. If the internal name starts with / it will be used as the full remembered path instead of the actual path at link time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 10:44 AM
11-16-2000 10:44 AM
Re: Getting error while linking shared library
Oops, change that "+Wl,+cdp" to "-Wl,+cdp".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2000 01:53 PM
11-16-2000 01:53 PM
Re: Getting error while linking shared library
Hi
Thank you for the reply.
>You can change the recorded path for a shared library using
>the +cdp option of ld. In your current case you would add
>+Wl,+cdp,/vobs/bldenv/hp11/Oracle/lib:/opt/Oracle/lib
>to replace the link directory with the appropriate runtime directory.
But Still I am having problem, Since at the link time
I will not know exactly where I will install oracle product.
>If you use the chatr command on a shared library it
>will show if it has an internal name.
libclntsh.sl.8.0 file is a symbolic link for libclntsh.sl and these both files are in the sam directory.
PROMPT>chatr /vobs/bldenv/hp11/Oracle/lib/libclntsh.sl
/vobs/bldenv/hp11/Oracle/lib/libclntsh.sl:
shared library
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
internal name:
libclntsh.sl.8.0
shared library list:
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libnss_dns.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libm.2
dynamic /usr/lib/libc.2
dynamic /usr/lib/libcl.2
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)
----------------------------
Que :
1> For Shared libraries, can I use runtime lib path different from link time library path.
2> Whether I specified any wrong aCC compilation/Linking option?
3> At the linking time, I tried using "/vobs/hp11/Oracle/lib/libclntsh.sl" instead of "-L/vobs/hp11/Oracle/lib -lclntsh".
aCC -g -Wl,-B,immediate -Wl,+s -o DbInit DbInit.o /vobs/hp11/Oracle/lib/libclntsh.sl /vobs/hp11/Visigenic/vbroker/lib/liborb_r.sl libpthread.sl
Whether these two ways of linking are same?
-Pravin
Thank you for the reply.
>You can change the recorded path for a shared library using
>the +cdp option of ld. In your current case you would add
>+Wl,+cdp,/vobs/bldenv/hp11/Oracle/lib:/opt/Oracle/lib
>to replace the link directory with the appropriate runtime directory.
But Still I am having problem, Since at the link time
I will not know exactly where I will install oracle product.
>If you use the chatr command on a shared library it
>will show if it has an internal name.
libclntsh.sl.8.0 file is a symbolic link for libclntsh.sl and these both files are in the sam directory.
PROMPT>chatr /vobs/bldenv/hp11/Oracle/lib/libclntsh.sl
/vobs/bldenv/hp11/Oracle/lib/libclntsh.sl:
shared library
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
internal name:
libclntsh.sl.8.0
shared library list:
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libnss_dns.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libm.2
dynamic /usr/lib/libc.2
dynamic /usr/lib/libcl.2
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)
----------------------------
Que :
1> For Shared libraries, can I use runtime lib path different from link time library path.
2> Whether I specified any wrong aCC compilation/Linking option?
3> At the linking time, I tried using "/vobs/hp11/Oracle/lib/libclntsh.sl" instead of "-L/vobs/hp11/Oracle/lib -lclntsh".
aCC -g -Wl,-B,immediate -Wl,+s -o DbInit DbInit.o /vobs/hp11/Oracle/lib/libclntsh.sl /vobs/hp11/Visigenic/vbroker/lib/liborb_r.sl libpthread.sl
Whether these two ways of linking are same?
-Pravin
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP