mirror of
https://github.com/ENSL/NS.git
synced 2024-12-19 09:11:12 +00:00
41 lines
4.8 KiB
HTML
41 lines
4.8 KiB
HTML
|
<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>STLport: Note for xlC & Visual Age C++ users</title><link href="doc.css" type="text/css" rel="stylesheet"></head><body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" vlink="#314A30" link="#314A30" text="black" bgcolor="white"><table border="0" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776"><img border="0" height="14" width="1" src="images/trans.gif"><br><a href="../index.html"><img src="images/stl_logo_doc.gif" border="0" height="80" width="80"></a><a href="http://www.stlport.com"><img border="0" height="80" width="461" src="images/t_doc2.gif"></a><br><img src="images/trans.gif" border="0" height="24" width="1"><br><img src="images/black.gif" border="0" height="1" width="776"><br><img src="images/trans.gif" border="0" height="24" width="1"></td></tr><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776"><img src="images/trans.gif" border="0" height="10" width="776"></td></tr><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776">
|
||
|
|
||
|
<span class="heading">Note for xlC & Visual Age C++ users</span>
|
||
|
<hr>
|
||
|
<h2>Known problems</h2>
|
||
|
<h4>Compiling</h4>
|
||
|
xlC & VAC++ require explicit template notation such as <tt>template_class<Param></tt>
|
||
|
where most others (conformant) accept just <tt>template_class</tt>
|
||
|
(inside template method bodies, etc):
|
||
|
<p><tt>template <class Param> class template_class {</tt> <br>
|
||
|
<tt>template_class foo() ; // error for xlC</tt> <br>
|
||
|
<tt>template_class<Param> foo() // OK</tt> <br>
|
||
|
<tt>.....</tt> <br>
|
||
|
<tt>}</tt></p>
|
||
|
<p>That is being worked around in this adaptation, but may cause
|
||
|
problems when porting template code from other platforms.</p>
|
||
|
<h4>Linking</h4>
|
||
|
Repository handling in this compilers is imperfect, so you may
|
||
|
experience various problems on link stage. The problems are generally of
|
||
|
two kinds : unresolved symbols and duplicate symbols. The latter problem
|
||
|
is not fatal, since the symbols are weak in that case. It may cause
|
||
|
unacceptable code bloat when it comes to large projects, however. To
|
||
|
overcome this problem, for all IBM compilers, STLport 3.2 enables separate
|
||
|
compilation with non-inline template members defined in .c file. <b>Note : you should enable corresponding
|
||
|
option in the compiler (/Ft+ or equivalent) to get use of this mode, as it is being enabled conditionally
|
||
|
based on the presence of builin macro ___TEMPINC__.</b><br>When compiling templates splitted to *.h/*.c
|
||
|
scheme, these compilers produce better results (around 50% code size reduction, less duplicate symbols).
|
||
|
The problem with undefined symbols is also caused by imperfect
|
||
|
repository handling, but it may require manual intervention. General
|
||
|
rule is : if you get "unresolved symbol" errors, explicit
|
||
|
instantiation will most likely help, for example:
|
||
|
<p><tt>Unresolved:</tt> <br>
|
||
|
<tt>__default_alloc_template<0, 0>::allocate(unsigned long)</tt> <br>
|
||
|
<tt>__default_alloc_template<0, 0>::deallocate(void*, unsigned
|
||
|
long) ></tt></p>
|
||
|
<p>To work around this problem, just instantiate <tt>__default_alloc_template<0,0></tt>
|
||
|
explicitly in some module:</p>
|
||
|
<p><tt>template class __default_alloc_template<0,0>;</tt></p>
|
||
|
<p> </p>
|
||
|
|
||
|
</td></tr><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776"><img src="images/trans.gif" border="0" height="20" width="50"><br><a href="index.html">Table of Contents</a><br></td></tr><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776"><img src="images/trans.gif" border="0" height="40" width="80"><br><img src="images/black.gif" border="0" height="1" width="776"></td></tr><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776"><img src="images/black.gif" border="0" height="1" width="776"></td></tr><tr valign="top" align="left"><td width="24"><img src="images/trans.gif" border="0" height="1" width="24"></td><td width="776"><img src="images/trans.gif" border="0" height="5" width="50"><br><span class="copyright">Copyright 2001 by STLport</span><br><img src="images/trans.gif" border="0" height="50" width="80"></td></tr></table></body></html>
|