Boost C++ Libraries: Ticket #11750: error when compiling boost 1.59 : error: two or more data types in declaration of 'parameter https://svn.boost.org/trac10/ticket/11750 <p> My platform is 32 bit RH Linux 5.1 with g++ 4.1.2. </p> <p> I have a dynamic (.so) library that includes boost/atomic.hpp. The library compiles without issues. When I build the main application that uses this library, I get the following errors related to boost/type_traits/detail hpp files. </p> <p> /path_to_boost/boost/type_traits/detail/ice_or.hpp:16: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:16: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:16: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:16: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:16: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:19: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:19: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:19: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:19: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_or.hpp:19: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:17: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:17: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:17: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:17: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:17: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:20: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:20: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:20: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:20: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_and.hpp:20: error: long, short, signed or unsigned invalid for 'parameter' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:16: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:19: error: expected primary-expression before 'signed' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:19: error: expected `)' before 'signed' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:22: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:25: error: expected primary-expression before 'signed' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:25: error: expected `)' before 'signed' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:29: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:29: error: type/value mismatch at argument 1 in template parameter list for 'template&lt;int &lt;anonymous&gt;, short int &lt;anonymous&gt; &gt; struct boost::type_traits::ice_eq' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:29: error: expected a constant of type 'int', got 'signed char' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:29: error: type/value mismatch at argument 2 in template parameter list for 'template&lt;int &lt;anonymous&gt;, short int &lt;anonymous&gt; &gt; struct boost::type_traits::ice_eq' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:29: error: expected a constant of type 'short int', got 'short int' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:29: error: template declaration of 'const bool boost::type_traits::value' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:30: error: two or more data types in declaration of 'parameter' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:30: error: type/value mismatch at argument 1 in template parameter list for 'template&lt;int &lt;anonymous&gt;, short int &lt;anonymous&gt; &gt; struct boost::type_traits::ice_ne' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:30: error: expected a constant of type 'int', got 'signed char' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:30: error: type/value mismatch at argument 2 in template parameter list for 'template&lt;int &lt;anonymous&gt;, short int &lt;anonymous&gt; &gt; struct boost::type_traits::ice_ne' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:30: error: expected a constant of type 'short int', got 'short int' /path_to_boost/boost/type_traits/detail/ice_eq.hpp:30: error: template declaration of 'const bool boost::type_traits::value' </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11750 Trac 1.4.3 anonymous Sat, 24 Oct 2015 07:27:38 GMT <link>https://svn.boost.org/trac10/ticket/11750#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11750#comment:1</guid> <description> <p> Which version of Boost? </p> <p> I ask because that header is deprecated and it's use removed from current Git, so probably this will disappear anyway... </p> </description> <category>Ticket</category> </item> <item> <author>subra raman <ramanats@…></author> <pubDate>Wed, 28 Oct 2015 15:58:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11750#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11750#comment:2</guid> <description> <p> This is with boost version 1.59.0. </p> <p> I tried the suggestion to remove the /path/boost/type_traits/detail/ice*.hpp files, then I get some errors as follows: </p> <p> ./boost/type_traits/ice.hpp:15:47: error: boost/type_traits/detail/ice_or.hpp: No such file or directory .../boost/type_traits/is_reference.hpp:30: error: 'ice_or' is not a member of 'boost::type_traits' </p> <p> So seems like these ice*.hpp files are needed. </p> </description> <category>Ticket</category> </item> <item> <author>subra raman <ramanats@…></author> <pubDate>Wed, 28 Oct 2015 17:35:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11750#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11750#comment:3</guid> <description> <p> I read a related thread on stackoverflow (<a class="ext-link" href="http://stackoverflow.com/questions/15406119/two-or-more-data-types-in-declaration-of-parameters-using-mingw-cross-compiler"><span class="icon">​</span>http://stackoverflow.com/questions/15406119/two-or-more-data-types-in-declaration-of-parameters-using-mingw-cross-compiler</a>) that this error could be because of multiple type definitions in a parameter list. </p> <p> Code snippet from ice_or.cpp, errors reported on lines 16 and 19. </p> <blockquote> <p> 13 namespace boost { 14 namespace type_traits { 15 16 template &lt;bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false&gt; 17 struct ice_or; 18 19 template &lt;bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7&gt; 20 struct ice_or 21 { 22 BOOST_STATIC_CONSTANT(bool, value = true); 23 }; </p> </blockquote> <p> I was able to get past this issue, by renaming the parameter names from ice_or.hpp, ice_and.hpp and ice_eq.hpp from b1.. b7 to a1.. a7. Not sure why b1, .. b7 were causing issue ? Maybe something in my code base has something to do with it ? </p> <p> Hopefully this will help some one :-) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 28 Oct 2015 17:39:13 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11750#comment:4 https://svn.boost.org/trac10/ticket/11750#comment:4 <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">wontfix</span> </li> </ul> <p> Sounds like maybe something was declaring those names as macros? </p> <p> In any case, like I said, the *next* release won't be using these files, so the problem should go away then. </p> Ticket