Boost C++ Libraries: Ticket #3854: unordered prime_list_template release-only link problem with sunpro toolset https://svn.boost.org/trac10/ticket/3854 <p> Missing symbol on sun solaris for <strong>release</strong> build of a project using unordered. We are currently using: </p> <p> Sun C++ 5.9 SunOS_sparc Patch 124863-05 2008/06/03 </p> <p> The related shared objects and executable compile cleanly without warnings. When the shared object is linked at runtime, the executable cannot link due to a missing symbol for </p> <p> prime_list_template&lt;T&gt;::length = 28; </p> <p> The original code works for debug versions, so we suspect a compiler bug or perhaps an inlining problem. </p> <p> Here is our solution: </p> <p> <strong></strong><strong></strong><strong></strong><strong>* </strong>* 81,87 <strong></strong> --- 81,95 ---- </p> <blockquote> <p> template&lt;typename T&gt; struct prime_list_template { </p> <blockquote> <p> static std::size_t const value[]; </p> </blockquote> </blockquote> <p> + #if defined(<span class="underline">SUNPRO_CC) </span></p> <p> + static std::ptrdiff_t const length = 28; </p> <p> + #else </p> <blockquote> <p> static std::ptrdiff_t const length; </p> </blockquote> <p> + #endif </p> <blockquote> <p> }; </p> </blockquote> <blockquote> <p> template&lt;typename T&gt; </p> </blockquote> <p> <strong></strong><strong></strong><strong></strong><strong>* </strong>* 93,100 <strong></strong> --- 101,113 ---- </p> <blockquote> <p> 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul, 1610612741ul, 3221225473ul, 4294967291ul }; </p> </blockquote> <p> + #if !defined(<span class="underline">SUNPRO_CC) </span></p> <blockquote> <p> template&lt;typename T&gt; std::ptrdiff_t const prime_list_template&lt;T&gt;::length = 28; </p> </blockquote> <p> + #endif </p> <blockquote> <p> typedef prime_list_template&lt;std::size_t&gt; prime_list; </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3854 Trac 1.4.3 Daniel James Thu, 21 Jan 2010 17:52:20 GMT status changed https://svn.boost.org/trac10/ticket/3854#comment:1 https://svn.boost.org/trac10/ticket/3854#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Daniel James Thu, 21 Jan 2010 18:01:55 GMT <link>https://svn.boost.org/trac10/ticket/3854#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3854#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59200" title="Set length of primes inside template on Sun C++. Refs #3854">[59200]</a>) Set length of primes inside template on Sun C++. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3854" title="#3854: Bugs: unordered prime_list_template release-only link problem with sunpro toolset (closed: fixed)">#3854</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Thu, 21 Jan 2010 18:07:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3854#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3854#comment:3</guid> <description> <p> The library has changed a fair amount since 1.37 so that patch doesn't apply any more. I just checked in a fix for the issue on trunk, but it's quite possible that there will be other similar problems with the new version. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Thu, 25 Feb 2010 19:05:03 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3854#comment:4 https://svn.boost.org/trac10/ticket/3854#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59911" title="Merge hash and unordered from trunk. - Replace uses of deprecated ...">[59911]</a>) Merge hash and unordered from trunk. </p> <ul><li>Replace uses of deprecated C++0x macros </li><li>Set length of primes inside template on Sun C++. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3854" title="#3854: Bugs: unordered prime_list_template release-only link problem with sunpro toolset (closed: fixed)">#3854</a> </li><li>Missing newline at end of file. </li></ul> Ticket