<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting error while linking shared library in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465100#M774071</link>
    <description>Oops, change that "+Wl,+cdp" to "-Wl,+cdp".</description>
    <pubDate>Thu, 16 Nov 2000 18:44:53 GMT</pubDate>
    <dc:creator>Mike Stroyan</dc:creator>
    <dc:date>2000-11-16T18:44:53Z</dc:date>
    <item>
      <title>Getting error while linking shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465098#M774069</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I am using aCC 3.1.5 compiler on HPUX 11.0.&lt;BR /&gt;One of my executable DbInit uses Oracle 8.1.5 shared library libclntsh.sl.&lt;BR /&gt;It was comipled &amp;amp; linked as follows:&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;The above oracle path is different at the client side.&lt;BR /&gt;I am keeping all oracle libraries in /opt/Oracle/lib direcory at the client side. So I am setting SHLIB_PATH &amp;amp; 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. &lt;BR /&gt;&lt;BR /&gt;/usr/lib/dld.sl: Can't open shared library: /vobs/bldenv/hp11/Oracle/lib/libclntsh.sl.8.0&lt;BR /&gt;/usr/lib/dld.sl: No such file or directory&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Que : &lt;BR /&gt;1&amp;gt; For Shared libraries, can I use different LD_LIBRARY_PATH/SHLIB_PATH different from path used while linking?&lt;BR /&gt;2&amp;gt; Whether I specified any wrong aCC compilation/Linking option?&lt;BR /&gt;3&amp;gt; For above scenario is there any way out.&lt;BR /&gt;&lt;BR /&gt;-Pravin</description>
      <pubDate>Thu, 16 Nov 2000 15:52:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465098#M774069</guid>
      <dc:creator>Pravin B</dc:creator>
      <dc:date>2000-11-16T15:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while linking shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465099#M774070</link>
      <description>You can change the recorded path for a shared library using the +cdp option of ld.  In your current case you would add&lt;BR /&gt;+Wl,+cdp,/vobs/bldenv/hp11/Oracle/lib:/opt/Oracle/lib&lt;BR /&gt;to replace the link directory with the appropriate runtime directory.&lt;BR /&gt;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.</description>
      <pubDate>Thu, 16 Nov 2000 18:39:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465099#M774070</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2000-11-16T18:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while linking shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465100#M774071</link>
      <description>Oops, change that "+Wl,+cdp" to "-Wl,+cdp".</description>
      <pubDate>Thu, 16 Nov 2000 18:44:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465100#M774071</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2000-11-16T18:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while linking shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465101#M774072</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Thank you for the reply.&lt;BR /&gt;&amp;gt;You can change the recorded path for a shared library using &lt;BR /&gt;&amp;gt;the +cdp option of ld. In your current case you would add &lt;BR /&gt;&amp;gt;+Wl,+cdp,/vobs/bldenv/hp11/Oracle/lib:/opt/Oracle/lib &lt;BR /&gt;&amp;gt;to replace the link directory with the appropriate runtime directory. &lt;BR /&gt;But Still I am having problem, Since at the link time &lt;BR /&gt;I will not know exactly where I will install oracle product.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If you use the chatr command on a shared library it &lt;BR /&gt;&amp;gt;will show if it has an internal name. &lt;BR /&gt;libclntsh.sl.8.0 file is a symbolic link for libclntsh.sl and these both files are in the sam directory.&lt;BR /&gt;PROMPT&amp;gt;chatr /vobs/bldenv/hp11/Oracle/lib/libclntsh.sl&lt;BR /&gt;/vobs/bldenv/hp11/Oracle/lib/libclntsh.sl: &lt;BR /&gt;         shared library &lt;BR /&gt;         shared library dynamic path search:&lt;BR /&gt;             SHLIB_PATH     disabled  second &lt;BR /&gt;             embedded path  disabled  first  Not Defined&lt;BR /&gt;         internal name:&lt;BR /&gt;             libclntsh.sl.8.0&lt;BR /&gt;         shared library list:&lt;BR /&gt;             dynamic   /usr/lib/librt.2&lt;BR /&gt;             dynamic   /usr/lib/libpthread.1&lt;BR /&gt;             dynamic   /usr/lib/libnss_dns.1&lt;BR /&gt;             dynamic   /usr/lib/libdld.2&lt;BR /&gt;             dynamic   /usr/lib/libm.2&lt;BR /&gt;             dynamic   /usr/lib/libc.2&lt;BR /&gt;             dynamic   /usr/lib/libcl.2&lt;BR /&gt;         shared vtable support disabled&lt;BR /&gt;         static branch prediction disabled&lt;BR /&gt;         executable from stack: D (default)&lt;BR /&gt;         kernel assisted branch prediction enabled&lt;BR /&gt;         lazy swap allocation disabled&lt;BR /&gt;         text segment locking disabled&lt;BR /&gt;         data segment locking disabled&lt;BR /&gt;         third quadrant private data space disabled&lt;BR /&gt;         fourth quadrant private data space disabled&lt;BR /&gt;         data page size: D (default)&lt;BR /&gt;         instruction page size: D (default)&lt;BR /&gt;----------------------------&lt;BR /&gt;Que : &lt;BR /&gt;1&amp;gt; For Shared libraries, can I use runtime lib path different from link time library path.&lt;BR /&gt;2&amp;gt; Whether I specified any wrong aCC compilation/Linking option? &lt;BR /&gt;3&amp;gt; At the linking time, I tried using "/vobs/hp11/Oracle/lib/libclntsh.sl" instead of "-L/vobs/hp11/Oracle/lib -lclntsh".&lt;BR /&gt;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&lt;BR /&gt;Whether these two ways of linking are same?&lt;BR /&gt;&lt;BR /&gt;-Pravin</description>
      <pubDate>Thu, 16 Nov 2000 21:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-error-while-linking-shared-library/m-p/2465101#M774072</guid>
      <dc:creator>Pravin B</dc:creator>
      <dc:date>2000-11-16T21:53:16Z</dc:date>
    </item>
  </channel>
</rss>

