<?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: How Do I create a Shared library in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398693#M706115</link>
    <description>the bundled c compiler is not very useful for application development. you'll need to use gcc or buy HP's ansi C and/or aCC (C++) compiler(s).&lt;BR /&gt;&lt;BR /&gt;cc/aCC : (cc = ansi C compiler, not bundled)&lt;BR /&gt;cc -b a.c b.c -o libab.so&lt;BR /&gt;aCC -b a.c b.c -o libab.so&lt;BR /&gt;&lt;BR /&gt;the gcc line is probably:&lt;BR /&gt;gcc -fpic -shared a.c b.c -o libab.so</description>
    <pubDate>Wed, 13 Oct 2004 03:59:27 GMT</pubDate>
    <dc:creator>ranganath ramachandra</dc:creator>
    <dc:date>2004-10-13T03:59:27Z</dc:date>
    <item>
      <title>How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398692#M706114</link>
      <description>I am ion HP-UX 64 bit Itanium 11.23i ,rx2600.&lt;BR /&gt;I would like to create a shared library from the C Objects as well as C++.&lt;BR /&gt;&lt;BR /&gt;I am using bundled C compiler that comes with the operating system and gcc compiler version 3.4.2 from GNU.&lt;BR /&gt;&lt;BR /&gt;Let's say I have two C programs. One with one function and another with functions.&lt;BR /&gt;&lt;BR /&gt;I would to create a shared library for the above.&lt;BR /&gt;&lt;BR /&gt;Similarly Let's say I have two C++ programs like above How do I create a shared library.&lt;BR /&gt;&lt;BR /&gt;Let's say I have &lt;BR /&gt;&lt;BR /&gt;a.c with functions void func1() ,void func2()&lt;BR /&gt;b.c with functions void func3()&lt;BR /&gt;&lt;BR /&gt;I want to create a shared library from the above as libab.so or libab.sl&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Any help appreciated,&lt;BR /&gt;Vinay&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Oct 2004 18:24:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398692#M706114</guid>
      <dc:creator>Vinay_19</dc:creator>
      <dc:date>2004-10-12T18:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398693#M706115</link>
      <description>the bundled c compiler is not very useful for application development. you'll need to use gcc or buy HP's ansi C and/or aCC (C++) compiler(s).&lt;BR /&gt;&lt;BR /&gt;cc/aCC : (cc = ansi C compiler, not bundled)&lt;BR /&gt;cc -b a.c b.c -o libab.so&lt;BR /&gt;aCC -b a.c b.c -o libab.so&lt;BR /&gt;&lt;BR /&gt;the gcc line is probably:&lt;BR /&gt;gcc -fpic -shared a.c b.c -o libab.so</description>
      <pubDate>Wed, 13 Oct 2004 03:59:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398693#M706115</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2004-10-13T03:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398694#M706116</link>
      <description>But this seems to create a 32-bit shared library while I am on a 64 bit Itanium machine.Is there an option in gcc which would create a 64-bit shared library .&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;vinay</description>
      <pubDate>Wed, 13 Oct 2004 08:09:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398694#M706116</guid>
      <dc:creator>Vinay_19</dc:creator>
      <dc:date>2004-10-13T08:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398695#M706117</link>
      <description>i guess you need to use gcc's "-mlp64" flag.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hp.com/go/gcc" target="_blank"&gt;http://www.hp.com/go/gcc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;for cc/aCC it is "+DD64"</description>
      <pubDate>Thu, 14 Oct 2004 00:45:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398695#M706117</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2004-10-14T00:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398696#M706118</link>
      <description>You forgot a very important option on the cc command (+Z for cc, -fPIC for gcc, which you /did/ mention), create sharable objects to enable shared libs&lt;BR /&gt;&lt;BR /&gt;# cc -O +Z -c file_a.c&lt;BR /&gt;# cc -O +Z -c file_b.c&lt;BR /&gt;# ld -b -o files.sl file_a.o file_b.o&lt;BR /&gt;# cc -O +Z -o test -L. -lfiles test.c&lt;BR /&gt;&lt;BR /&gt;# gcc -O -fPIC -c file_a.c&lt;BR /&gt;# gcc -O -fPIC -c file_b.c&lt;BR /&gt;# ld -b -o files.sl file_a.o file_b.o&lt;BR /&gt;# gcc -O -fPIC -o test -L. -lfiles test.c&lt;BR /&gt;&lt;BR /&gt;I don't have an Itanium here, but I've build perl on on of HP's testdrive systems, where I noted that Itanium, other than pa-risc, can use gcc to build both 32bit (default) and 64bit (-mlp64) objects. On pa-risc machines you need two different compilers for 32 and 64bitness&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 14 Oct 2004 01:48:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398696#M706118</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-10-14T01:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398697#M706119</link>
      <description>HP's ELF (PA64 and IA) compilers emit PIC code by default, that is why i left out "+z".&lt;BR /&gt;&lt;BR /&gt;getting them to emit non-PIC code is not easy.&lt;BR /&gt;&lt;BR /&gt;also, PA32 cc understands "-b" means "+z" - PA32 aCC doesnt, they are fixing that.&lt;BR /&gt;&lt;BR /&gt;building c++ libraries by using ld directly is discouraged. it leads to problems most of the time.</description>
      <pubDate>Thu, 14 Oct 2004 03:41:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398697#M706119</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2004-10-14T03:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398698#M706120</link>
      <description>Thank you for this additional info!&lt;BR /&gt;&lt;BR /&gt;no points please&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 14 Oct 2004 04:41:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398698#M706120</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-10-14T04:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I create a Shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398699#M706121</link>
      <description>Thank you for responding , I will try all of your suggestions and award points&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Oct 2004 07:37:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-create-a-shared-library/m-p/3398699#M706121</guid>
      <dc:creator>Vinay_19</dc:creator>
      <dc:date>2004-10-14T07:37:54Z</dc:date>
    </item>
  </channel>
</rss>

