Boost C++ Libraries: Ticket #470: Cannot compile on Sparc/NetBSD: redefinition of `struct https://svn.boost.org/trac10/ticket/470 <pre class="wiki">I cannot compile Boost on my UltraSparc (64 bits) machine running NetBSD: ...found 4111 targets... ...updating 325 targets... gcc-C++-action /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/build/bin/boost/libs/dat e_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/threading-multi/gr eg_month.o In file included from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/type_traits /intrinsics.hpp:39, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/type_traits /is_union.hpp:16, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/type_traits /is_class.hpp:14, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/detail/indi rect_traits.hpp:10, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/iterator/de tail/facade_iterator_category.hpp:27, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/iterator/it erator_facade.hpp:14, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/iterator/it erator_adaptor.hpp:15, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/token_itera tor.hpp:21, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/tokenizer.h pp:20, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/date_time/d ate_parsing.hpp:12, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/date_time/g regorian/parsers.hpp:13, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/boost/date_time/g regorian/greg_facet.hpp:14, from /usr/pkgsrc/devel/boost-libs/work/boost_1_33_0/libs/date_time/sr c/gregorian/greg_month.cpp:15: /usr/include/g++/type_traits.h:55: error: redefinition of `struct __true_type' /usr/include/g++/bits/type_traits.h:90: error: previous definition of `struct __true_type' /usr/include/g++/type_traits.h:58: error: redefinition of `struct __false_type' /usr/include/g++/bits/type_traits.h:91: error: previous definition of `struct __false_type' /usr/include/g++/type_traits.h:62: error: redefinition of `struct __type_traits&lt;_Tp&gt;' /usr/include/g++/bits/type_traits.h:94: error: previous definition of `struct __type_traits&lt;_Tp&gt;' /usr/include/g++/type_traits.h:96: error: redefinition of `struct __type_traits&lt;bool&gt;' /usr/include/g++/bits/type_traits.h:123: error: previous definition of `struct __type_traits&lt;bool&gt;' /usr/include/g++/type_traits.h:106: error: redefinition of `struct __type_traits&lt;char&gt;' NetBSD 2.0.1 gcc: % g++ -v Using built-in specs. Configured with: /home/nick/work/netbsd/src/tools/gcc/../../gnu/dist/gcc/configure --enable-long-long --disable-multilib --enable-threads --disable-symvers --build=i386-unknown-netbsdelf --host=sparc64--netbsd --target=sparc64--netbsd Thread model: posix gcc version 3.3.3 (NetBSD nb3 20040520) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/470 Trac 1.4.3 John Maddock Tue, 23 Aug 2005 16:41:22 GMT <link>https://svn.boost.org/trac10/ticket/470#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/470#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=14804 I'm not sure what we do about that: the bottom line is that the system should only have one version of type_traits.h. I've looked at cygwin and Linux and these do have two versions of that file but they are identical, or at least they both use _TYPE_TRAITS_H as an include guard. Can you try something like the following program and see if it reproduces the issue, if it does, can you please report the bug to either the gcc or the NetBSD folks? #include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;iterator&gt; #include &lt;algorithm&gt; #include &lt;type_traits.h&gt; Thanks, John Maddock. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>bortz</dc:creator> <pubDate>Wed, 24 Aug 2005 08:06:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/470#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/470#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=25865 Indeed, the sample program suggested by johnmaddock fails in the same way on the Sparc/NetBSD (while it compiles fine on a Sparc/Linux). Reported to NetBSD people. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 07 Oct 2005 12:27:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/470#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/470#comment:3</guid> <description> <pre class="wiki">Logged In: YES user_id=14804 I'm going to add a fix to boost/type_traits/intrinsics.hpp to include &lt;algorithm&gt; rather than &lt;type_traits.h&gt; in order to avoid this issue. It's a rather fragile fix, but I believe it will do the job. John. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 07 Oct 2005 12:27:20 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/470#comment:4 https://svn.boost.org/trac10/ticket/470#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> Ticket