<?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 shared object symbol visibility in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5865553#M638802</link>
    <description>&lt;P&gt;I'm trying to compile a C++ shared object, and the weirdest thing happens. Whenever some code is in there, all the symbols from a certain compilation object dissappear. When I remove that code, they appear. For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;boost/ptr_container/ptr_vector.hpp&amp;gt;

namespace nsp
{

    template &amp;lt;typename Type&amp;gt;
    struct Holder
    {
        boost::ptr_vector&amp;lt;Type&amp;gt; vec;
    };

    class Object { int a; };

    Holder&amp;lt;Object&amp;gt; holder;

    void testIt()
    {
        // holder.vec.push_back(new Object());
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$g++ -shared test.cpp -o test.so -I${BOOST_INCLUDE_GCC}/1.51&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ nm &lt;SPAN&gt;test&lt;/SPAN&gt;.so | grep testIt | c++filt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[258] | 67118528| 32|FUNC |GLOB |0| .text|nsp::testIt()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I uncomment the line inside 'testIt', the 'nm' command shows nothing. If there's no 'Holder' template, just the 'vec', the symbols appears. If the type is just an 'int', the symbol appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be the cause of this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ g++ --version&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;g++ (GCC) 4.7.0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Copyright (C) 2012 Free Software Foundation, Inc.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;This is free software; see the source for copying conditions. There is NO&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ uname -a&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;HP-UX rx8km B.11.31 U ia64 2229485251 unlimited-user license&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2012 19:37:49 GMT</pubDate>
    <dc:creator>chilabot</dc:creator>
    <dc:date>2012-11-13T19:37:49Z</dc:date>
    <item>
      <title>shared object symbol visibility</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5865553#M638802</link>
      <description>&lt;P&gt;I'm trying to compile a C++ shared object, and the weirdest thing happens. Whenever some code is in there, all the symbols from a certain compilation object dissappear. When I remove that code, they appear. For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;boost/ptr_container/ptr_vector.hpp&amp;gt;

namespace nsp
{

    template &amp;lt;typename Type&amp;gt;
    struct Holder
    {
        boost::ptr_vector&amp;lt;Type&amp;gt; vec;
    };

    class Object { int a; };

    Holder&amp;lt;Object&amp;gt; holder;

    void testIt()
    {
        // holder.vec.push_back(new Object());
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$g++ -shared test.cpp -o test.so -I${BOOST_INCLUDE_GCC}/1.51&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ nm &lt;SPAN&gt;test&lt;/SPAN&gt;.so | grep testIt | c++filt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[258] | 67118528| 32|FUNC |GLOB |0| .text|nsp::testIt()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I uncomment the line inside 'testIt', the 'nm' command shows nothing. If there's no 'Holder' template, just the 'vec', the symbols appears. If the type is just an 'int', the symbol appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be the cause of this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ g++ --version&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;g++ (GCC) 4.7.0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Copyright (C) 2012 Free Software Foundation, Inc.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;This is free software; see the source for copying conditions. There is NO&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ uname -a&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;HP-UX rx8km B.11.31 U ia64 2229485251 unlimited-user license&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2012 19:37:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5865553#M638802</guid>
      <dc:creator>chilabot</dc:creator>
      <dc:date>2012-11-13T19:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: shared lib symbol visibility (hidden local symbol)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5865975#M638803</link>
      <description>&lt;P&gt;It would be helpful to run nm(1) on the object file instead of a shlib.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;If the type is just an 'int', the symbol appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The template type as in: ?&lt;/P&gt;&lt;P&gt;Holder&amp;lt;int&amp;gt; holder;&lt;/P&gt;&lt;P&gt;Or:&lt;/P&gt;&lt;P&gt;boost::ptr_vector&amp;lt;int&amp;gt; vec;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:43:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5865975#M638803</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-11-14T19:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: shared lib symbol visibility</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866309#M638804</link>
      <description>&lt;P&gt;&amp;gt;It would be helpful to run nm(1) on an object file instead of a shlib.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should be run on a shlib?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;If the type is just an 'int', the symbol appears.&lt;/P&gt;&lt;P&gt;&amp;gt;The template type as in: ?&lt;/P&gt;&lt;P&gt;&amp;gt;Holder&amp;lt;int&amp;gt; holder;&lt;/P&gt;&lt;P&gt;&amp;gt;Or:&lt;/P&gt;&lt;P&gt;&amp;gt;boost::ptr_vector&amp;lt;int&amp;gt; vec;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Holder&amp;lt;int&amp;gt; holder;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 13:42:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866309#M638804</guid>
      <dc:creator>chilabot</dc:creator>
      <dc:date>2012-11-14T13:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: shared lib symbol visibility (hidden local symbol)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866675#M638805</link>
      <description>&lt;P&gt;&amp;gt;What should be run on a shlib?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You already did this.&amp;nbsp; Now run nm(1) on the object file.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:43:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866675#M638805</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-11-14T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: shared lib symbol visibility (missing symbol)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866683#M638806</link>
      <description>&lt;P&gt;I did that and the symbol appears. I tried using the shared object anyways and it worked even thou the nm does not show the symbol. Weird.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:32:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866683#M638806</guid>
      <dc:creator>chilabot</dc:creator>
      <dc:date>2012-11-14T19:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: shared lib symbol visibility (hidden local symbol)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866703#M638807</link>
      <description>&lt;P&gt;&amp;gt;I did that and the symbol appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you provide the nm(1) output, perhaps the symbol is only local and so doesn't get put in the shlib symbol table?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:42:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shared-object-symbol-visibility/m-p/5866703#M638807</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-11-14T19:42:34Z</dc:date>
    </item>
  </channel>
</rss>

