Boost C++ Libraries: Ticket #6055: unqualified sqrt() fails to compile on SunCC/SunOS https://svn.boost.org/trac10/ticket/6055 <p> Compiling uBlas' test_complex_norms on SunOS with SunCC: </p> <pre class="wiki">] sunCC -library=stlport4 -I../ ../libs/numeric/ublas/test/test_complex_norms.cpp "../libs/numeric/ublas/test/test_complex_norms.cpp", line 37: Error: The function "sqrt" must have a prototype. "../libs/numeric/ublas/test/test_complex_norms.cpp", line 37: Error: The function "sqrt" must have a prototype. "../libs/numeric/ublas/test/test_complex_norms.cpp", line 65: Error: The function "sqrt" must have a prototype. "../libs/numeric/ublas/test/test_complex_norms.cpp", line 65: Error: The function "sqrt" must have a prototype. 4 Error(s) detected. </pre><p> The standard math header included here - &lt;cmath&gt; - does not inject math functions into the global namespace. The only standard way to use these functions (sqrt included) is via std:: namespace. </p> <p> All the uses of sqrt should be converted to std::sqrt, otherwise compilers with strictly conforming STLs (like SunCC -stlport4) will not be able to compile. </p> <p> std::sqrt works fine with all the compilers I tried (SunCC, g++). </p> <p> (suggested patch attached) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6055 Trac 1.4.3 Fedor Sergeev <Fedor.Sergeev@…> Tue, 25 Oct 2011 10:35:11 GMT attachment set https://svn.boost.org/trac10/ticket/6055 https://svn.boost.org/trac10/ticket/6055 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">diffs</span> </li> </ul> <p> patch for std::sqrt </p> Ticket Fedor Sergeev <Fedor.Sergeev@…> Tue, 25 Oct 2011 10:38:54 GMT <link>https://svn.boost.org/trac10/ticket/6055#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6055#comment:1</guid> <description> <blockquote class="citation"> <p> compilers with strictly conforming STLs (like SunCC) </p> </blockquote> <p> Sorry for slightly misleading cut-n-paste from a different ticket. No STL usage here. </p> <p> Meant "compilers with strictly conforming standard headers (like SunCC)". </p> </description> <category>Ticket</category> </item> </channel> </rss>