Boost C++ Libraries: Ticket #11522: Boost.Geometry - not enough namespace prefixing in boost/geometry/detail/buffer/buffered_ring.hpp https://svn.boost.org/trac10/ticket/11522 <p> Compiling v 1.58 with Visual Studio 2012, I get the following errors: </p> <p> 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2039: 'buffered_ring' : is not a member of 'boost::geometry::traits::detail' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2065: 'buffered_ring' : undeclared identifier 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2974: 'boost::geometry::traits::tag' : invalid template argument for 'Geometry', type expected 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2143: syntax error : missing ';' before '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2976: 'boost::geometry::traits::tag' : too few template arguments 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(98): error C2059: syntax error : '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(99): error C2143: syntax error : missing ';' before '{' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(99): error C2447: '{' : missing function header (old-style formal list?) 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2039: 'buffered_ring' : is not a member of 'boost::geometry::traits::detail' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2065: 'buffered_ring' : undeclared identifier 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2974: 'boost::geometry::traits::point_order' : invalid template argument for 'Ring', type expected 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\point_order.hpp(70) : see declaration of 'boost::geometry::traits::point_order' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2143: syntax error : missing ';' before '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(105): error C2059: syntax error : '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(106): error C2143: syntax error : missing ';' before '{' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(106): error C2447: '{' : missing function header (old-style formal list?) 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2039: 'buffered_ring' : is not a member of 'boost::geometry::traits::detail' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2065: 'buffered_ring' : undeclared identifier 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2974: 'boost::geometry::traits::closure' : invalid template argument for 'G', type expected 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\closure.hpp(76) : see declaration of 'boost::geometry::traits::closure' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2143: syntax error : missing ';' before '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(112): error C2059: syntax error : '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(113): error C2143: syntax error : missing ';' before '{' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(113): error C2447: '{' : missing function header (old-style formal list?) 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C3083: 'buffer': the symbol to the left of a '::' must be a type 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2039: 'buffered_ring_collection' : is not a member of 'boost::geometry::traits::detail' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2065: 'buffered_ring_collection' : undeclared identifier 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2974: 'boost::geometry::traits::point_type' : invalid template argument for 'Geometry', type expected 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\point_type.hpp(44) : see declaration of 'boost::geometry::traits::point_type' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2143: syntax error : missing ';' before '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(119): error C2059: syntax error : '&gt;' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(120): error C2143: syntax error : missing ';' before '{' 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(120): error C2447: '{' : missing function header (old-style formal list?) 1&gt;d:\boost\boost_1_58_0\boost\geometry\algorithms\detail\buffer\buffered_ring.hpp(128): error C2976: 'boost::geometry::traits::tag' : too few template arguments 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\linestring.hpp(119): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\linestring.hpp(119): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\polygon.hpp(174): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\polygon.hpp(174): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\multi_point.hpp(118): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\multi_point.hpp(118): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\multi_linestring.hpp(112): error C3855: 'boost::geometry::traits::tag': template parameter 'Enable' is incompatible with the declaration 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\multi_linestring.hpp(112): error C2977: 'boost::geometry::traits::tag' : too many template arguments 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' 1&gt;d:\boost\boost_1_58_0\boost\geometry\geometries\point_xy.hpp(88): error C2953: 'boost::geometry::traits::tag' : class template has already been defined 1&gt; d:\boost\boost_1_58_0\boost\geometry\core\tag.hpp(42) : see declaration of 'boost::geometry::traits::tag' </p> <hr /> <p> The problem is that the namespace hierarchy is such that lines with the errors are in a different namespace hierarchy (boost::geometry::detail) than the structs they are referring to (boost::geometry). Because these references aren't fully prefixed, the compiler can't find them (there is no "using namespace boost::geometry" preceding their inclusion. Libraries should not assume that users will specify such a thing.) This can be fixed by editing lines 97-128 to be the following: </p> <hr /> <p> template &lt;typename Ring&gt; struct tag&lt;boost::geometry::detail::buffer::buffered_ring&lt;Ring&gt; &gt; { </p> <blockquote> <p> typedef ring_tag type; </p> </blockquote> <p> }; </p> <p> template &lt;typename Ring&gt; struct point_order&lt;boost::geometry::detail::buffer::buffered_ring&lt;Ring&gt; &gt; { </p> <blockquote> <p> static const order_selector value = geometry::point_order&lt;Ring&gt;::value; </p> </blockquote> <p> }; </p> <p> template &lt;typename Ring&gt; struct closure&lt;boost::geometry::detail::buffer::buffered_ring&lt;Ring&gt; &gt; { </p> <blockquote> <p> static const closure_selector value = geometry::closure&lt;Ring&gt;::value; </p> </blockquote> <p> }; </p> <p> template &lt;typename Ring&gt; struct point_type&lt;boost::geometry::detail::buffer::buffered_ring_collection&lt;Ring&gt; &gt; { </p> <blockquote> <p> typedef typename geometry::point_type&lt;Ring&gt;::type type; </p> </blockquote> <p> }; </p> <p> template &lt;typename Ring&gt; struct tag&lt;boost::geometry::detail::buffer::buffered_ring_collection&lt;Ring&gt; &gt; { </p> <blockquote> <p> typedef boost::geometry::detail::buffer::buffered_ring_collection_tag type; </p> </blockquote> <p> }; </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11522 Trac 1.4.3 Barend Gehrels Sun, 01 Nov 2015 10:10:12 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/11522#comment:1 https://svn.boost.org/trac10/ticket/11522#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.60.0</span> </li> </ul> <p> Thanks for the message. So somewhere there is a traits::detail namespace in the other code which triggers this error. I prefixed geometry:: as we usually do. </p> Ticket