<?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: static and shared library options for aCC in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208700#M678607</link>
    <description>&amp;gt;module1 should be built as static library.&lt;BR /&gt;&lt;BR /&gt;(The correct HP-UX terminology is archive lib.)&lt;BR /&gt;What OS and architecture are you using?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I am looking for aCC command options to achieve this goal.&lt;BR /&gt;&lt;BR /&gt;aCC -c foo1.c foo2.c&lt;BR /&gt;ar -rv libmod1.a foo1.o foo2.o&lt;BR /&gt;&lt;BR /&gt;aCC -c +z foo3.c foo4.c&lt;BR /&gt;aCC -b o libmod2.so foo3.o foo4.o -L . -lmod1&lt;BR /&gt;&lt;BR /&gt;aCC -c foo5.c foo6.c&lt;BR /&gt;aCC -o module3 foo5.o foo6.o -L . -lmod2&lt;BR /&gt;&lt;BR /&gt;For Integrity see:&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/14487/libs.htm" target="_blank"&gt;http://docs.hp.com/en/14487/libs.htm&lt;/A&gt;</description>
    <pubDate>Wed, 11 Nov 2009 11:20:48 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-11-11T11:20:48Z</dc:date>
    <item>
      <title>static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208699#M678606</link>
      <description>Hi,&lt;BR /&gt;I have &lt;BR /&gt;&lt;BR /&gt;module1 should be built as static library.&lt;BR /&gt;module2 should be a shared library and it should like module1 statically.&lt;BR /&gt;&lt;BR /&gt;module3 is an executable which dynamically links to module2 library.&lt;BR /&gt;&lt;BR /&gt;I am looking for aCC command options to achieve this goal.&lt;BR /&gt;&lt;BR /&gt;It should work on 64 and 32 bit OS.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ram</description>
      <pubDate>Wed, 11 Nov 2009 00:54:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208699#M678606</guid>
      <dc:creator>Ram Regar</dc:creator>
      <dc:date>2009-11-11T00:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208700#M678607</link>
      <description>&amp;gt;module1 should be built as static library.&lt;BR /&gt;&lt;BR /&gt;(The correct HP-UX terminology is archive lib.)&lt;BR /&gt;What OS and architecture are you using?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I am looking for aCC command options to achieve this goal.&lt;BR /&gt;&lt;BR /&gt;aCC -c foo1.c foo2.c&lt;BR /&gt;ar -rv libmod1.a foo1.o foo2.o&lt;BR /&gt;&lt;BR /&gt;aCC -c +z foo3.c foo4.c&lt;BR /&gt;aCC -b o libmod2.so foo3.o foo4.o -L . -lmod1&lt;BR /&gt;&lt;BR /&gt;aCC -c foo5.c foo6.c&lt;BR /&gt;aCC -o module3 foo5.o foo6.o -L . -lmod2&lt;BR /&gt;&lt;BR /&gt;For Integrity see:&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/14487/libs.htm" target="_blank"&gt;http://docs.hp.com/en/14487/libs.htm&lt;/A&gt;</description>
      <pubDate>Wed, 11 Nov 2009 11:20:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208700#M678607</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-11T11:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208701#M678608</link>
      <description>Thank you for ur response. &lt;BR /&gt;&lt;BR /&gt;I have this box.&lt;BR /&gt;-bash-3.2$ uname -a&lt;BR /&gt;HP-UX ramregar-hp11i B.11.23 U ia64 1869050062 unlimited-user license&lt;BR /&gt;-bash-3.2$ &lt;BR /&gt;&lt;BR /&gt;I want to build 32-bit and 64-bit builds on the same box.&lt;BR /&gt;Thanks,&lt;BR /&gt;Ram&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2009 18:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208701#M678608</guid>
      <dc:creator>Ram Regar</dc:creator>
      <dc:date>2009-11-11T18:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208702#M678609</link>
      <description>&amp;gt;I want to build 32-bit and 64-bit builds on the same box.&lt;BR /&gt;&lt;BR /&gt;The default is 32 bit or you can use +DD32.&lt;BR /&gt;And +DD64 for 64 bit.</description>
      <pubDate>Thu, 12 Nov 2009 12:38:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208702#M678609</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-12T12:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208703#M678610</link>
      <description>&lt;BR /&gt;Thank you so much for your support so far. Please do continue until I finish this.&lt;BR /&gt;&lt;BR /&gt;Module1 a static library.&lt;BR /&gt;aCC -O -g0 -O2 +Oopenmp +z +DD64 -b -Wl,-ashared -D_HPUX -D__LP64__ -DPIC -I/build/jdk/include -lunalign -o/build/rel/lib/static/libmodule1.a *.cpp *.c&lt;BR /&gt;&lt;BR /&gt;Module2 a dynamic library which statically links the Module1&lt;BR /&gt;aCC -O -g0 -O2 +Oopenmp +z +DD64 -b -n -v  -D_HPUX -D__LP64__ -I/build/jdk/include -Wl,-L/build/rel/lib/static/ -lmodule1 -o/build/rel/lib/libmodule.so *.cpp *.c&lt;BR /&gt;&lt;BR /&gt;Module3 a dynamic library which statically links the module1&lt;BR /&gt;aCC -O -g  -O2 +Oopenmp +z +DD64 -b -v -ashared -D_HPUX -D__LP64__ -L/build/rel/lib/static/ -lmodule1 -o/build/rel/lib/libmodule3.so *.cpp&lt;BR /&gt;&lt;BR /&gt;Module4 an executable which dynamically links module2. Module2 loads Module3 at runtime.&lt;BR /&gt;aCC +DD64 +Oopenmp -I/build/clients/include -L/build/rel/lib/ -lmodule2 -lrt -lunalign -o/build/bin/module4 *.cpp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;aCC version:&lt;BR /&gt;aCC: HP C/aC++ B3910B A.06.23 [May 18, 2009]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Problem:&lt;BR /&gt;When I run module4 &lt;BR /&gt;/usr/lib/hpux64/dld.so: Unsatisfied data symbol '_ZTV14MyListener' in load module '../lib/libmodule2.so'.&lt;BR /&gt;Killed&lt;BR /&gt;&lt;BR /&gt;I looked in library with nm command. Here is the output.&lt;BR /&gt;&lt;BR /&gt;build@hp16 /build/rel/lib $ nm -D libmodule2.so | grep MyListener &lt;BR /&gt;[4825]   |   4611686018430846112|     288|FUNC |GLOB |0|   .text|_Z17createNewListenerP14MyListenerPP9_listenerPFvP12_space_eventPvES6_&lt;BR /&gt;[4748]   |   4611686018431064384|     416|FUNC |GLOB |0|   .text|_ZN6CSpace5startEP14MyListenerP11CBrowserDef&lt;BR /&gt;[2880]   |                     0|       0|OBJT |GLOB |0|   UNDEF|_ZTV14MyListener&lt;BR /&gt;[1065]   |   4611686018431074480|     112|FUNC |LOCAL|0|   .text|__sinit_MyListener_cpp_&lt;BR /&gt;[1064]   |                     0|       0|FILE |LOCAL|0|     ABS|MyListener.cpp&lt;BR /&gt;build@hp16 /build/rel/lib $&lt;BR /&gt;&lt;BR /&gt;I would appreciate your help. Please do review compiler options and suggest me the changes.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ram Regar&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Nov 2009 16:32:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208703#M678610</guid>
      <dc:creator>Ram Regar</dc:creator>
      <dc:date>2009-11-14T16:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208704#M678611</link>
      <description>&amp;gt;module1 a static library.&lt;BR /&gt;&lt;BR /&gt;Again, please use the correct terminology.  There are only archive and shared libs.&lt;BR /&gt;In this case, this is a shared lib since you used -b and not ar(1).&lt;BR /&gt;&lt;BR /&gt;&amp;gt;aCC -O -g0 -O2 +Oopenmp +z +DD64 -b -Wl,-ashared -D__LP64__ -lunalign -o /build/rel/lib/static/libmodule1.a *.cpp *.c&lt;BR /&gt;&lt;BR /&gt;There is no need for both -O and +O2.  There is no need to define -D__LP64__ or -Wl,-ashared, they are set by the driver or the default.  Also, why bother with +Oopenmp?&lt;BR /&gt;Also, you should NOT use -b with libmodule1.a.  Rename it to libmodule1.so.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;module2 a dynamic library which statically links the module1&lt;BR /&gt;&amp;gt;aCC -O -g0 -O2 +Oopenmp +z +DD64 -b -n -v -Wl,-L/build/rel/lib/static/ -lmodule1 -o /build/rel/lib/libmodule.so *.cpp *.c&lt;BR /&gt;&lt;BR /&gt;The output should be libmodule2.so&lt;BR /&gt;Remove useless -n.  Also remove "-Wl," before -L.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;module4 an executable which dynamically links module2. module2 loads module3 at runtime.&lt;BR /&gt;&amp;gt;aCC +DD64 +Oopenmp -lmodule2 -lrt -lunalign -o/build/bin/module4 *.cpp&lt;BR /&gt;&lt;BR /&gt;And also has module1 as a dependent shlib.&lt;BR /&gt;&lt;BR /&gt;dld.so: Unsatisfied data symbol _ZTV14MyListener load module ../lib/libmodule2.so&lt;BR /&gt;&amp;gt;I looked in library with nm command.&lt;BR /&gt;&lt;BR /&gt;Where should it be defined?  Where have you defined the class MyListener and the first non-inline virtual function?</description>
      <pubDate>Sun, 15 Nov 2009 07:34:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208704#M678611</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-15T07:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208705#M678612</link>
      <description>Thank you Dennis Handly I appreciate your help. Your quick help has been very helpful to me. Thank you.</description>
      <pubDate>Tue, 24 Nov 2009 00:04:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208705#M678612</guid>
      <dc:creator>Ram Regar</dc:creator>
      <dc:date>2009-11-24T00:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: static and shared library options for aCC</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208706#M678613</link>
      <description>Dennis Handly is a great help. He definitely deserve 100/100.</description>
      <pubDate>Tue, 24 Nov 2009 00:05:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-and-shared-library-options-for-acc/m-p/5208706#M678613</guid>
      <dc:creator>Ram Regar</dc:creator>
      <dc:date>2009-11-24T00:05:15Z</dc:date>
    </item>
  </channel>
</rss>

