Boost C++ Libraries: Ticket #5042: error: redefinition of 'size_t boost::asio::detail::calculate_hash_value(SOCKET)' https://svn.boost.org/trac10/ticket/5042 <p> Hello! </p> <p> I am using compiler i686-pc-mingw32-g++ from openSUSE repository: </p> <pre class="wiki">phprus@notebook-hp6730b:/usr/lib&gt; i686-pc-mingw32-g++ -v Using built-in specs. COLLECT_GCC=i686-pc-mingw32-g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-mingw32/4.5.2/lto-wrapper Target: i686-pc-mingw32 Configured with: ../configure --prefix=/usr --bindir=/usr/bin --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-pc-mingw32 --with-gnu-as --with-gnu-ld --verbose --without-newlib --disable-multilib --disable-plugin --with-system-zlib --disable-nls --without-included-gettext --disable-win32-registry --enable-version-specific-runtime-libs --with-sysroot=/usr/i686-pc-mingw32/sys-root --enable-languages=c,c++,fortran,objc,obj-c++ --without-x --enable-hash-synchronization Thread model: win32 gcc version 4.5.2 (GCC) </pre><p> Boost version 1.44.0 </p> <p> At header-file &lt;boost/asio.hpp&gt; usage there is a compilation error: </p> <pre class="wiki">In file included from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/reactor_op_queue.hpp:19:0, from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/select_reactor.hpp:29, from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/reactor.hpp:27, from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/win_iocp_socket_service.hpp:35, from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/datagram_socket_service.hpp:24, from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/basic_datagram_socket.hpp:21, from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio.hpp:20, from ********/SimpleClient.cpp:17: /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/hash_map.hpp: In function 'size_t boost::asio::detail::calculate_hash_value(SOCKET)': /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/hash_map.hpp:46:20: error: redefinition of 'size_t boost::asio::detail::calculate_hash_value(SOCKET)' /usr/i686-pc-mingw32/sys-root/mingw/include/boost/asio/detail/hash_map.hpp:34:20: error: 'size_t boost::asio::detail::calculate_hash_value(int)' previously defined here </pre><p> SOCKET type equal INT_PTR (/usr/i686-pc-mingw32/sys-root/mingw/include/mingw_inc/_socket_types.h) On win32 INT_PTR equal int (/usr/i686-pc-mingw32/sys-root/mingw/include/basetds.h) </p> <p> It possible usage boost::enable_if for detect this collision. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5042 Trac 1.4.3 chris_kohlhoff Thu, 06 Jan 2011 11:14:16 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5042#comment:1 https://svn.boost.org/trac10/ticket/5042#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">wontfix</span> </li> </ul> <p> MinGW bug. SOCKET should be an unsigned int on Windows. It looks correct in older versions of MinGW, so please take it up with them. </p> Ticket Vladislav <phprus@…> Thu, 06 Jan 2011 12:28:00 GMT cc set https://svn.boost.org/trac10/ticket/5042#comment:2 https://svn.boost.org/trac10/ticket/5042#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">phprus@…</span> added </li> </ul> <p> Please, tell in what versions MinGW it works? </p> Ticket chris_kohlhoff Thu, 06 Jan 2011 12:39:32 GMT <link>https://svn.boost.org/trac10/ticket/5042#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5042#comment:3</guid> <description> <p> My debian box says: </p> <pre class="wiki">Package: mingw32 Priority: optional Section: devel Installed-Size: 142880 Maintainer: Ron Lee &lt;ron@debian.org&gt; Architecture: amd64 Version: 4.2.1.dfsg-2 Depends: mingw32-binutils, mingw32-runtime (&gt;= 3.7), libc6 (&gt;= 2.7) Suggests: gcc-doc, cpp-doc Filename: pool/main/m/mingw32/mingw32_4.2.1.dfsg-2_amd64.deb Size: 20918294 MD5sum: 5a552eefd2481123e151607a83c9f699 SHA1: 64e359780ce6337da4d2652be191022554111ea1 SHA256: 972f1220a277c680a520ea890f72904771e93a444c99b880ad315eda5c74b8db Description: Minimalist GNU win32 (cross) compiler A Linux hosted, win32 target, cross compiler for C/C++ . Freedom through obsolescence. Those who still really need to can now build windows executables from the comfort of Debian. . This package contains the C and C++ cross compilers. Tag: devel::{compiler,lang:c,lang:c++}, interface::commandline, role::program, scope::utility, works-with::software:source </pre> </description> <category>Ticket</category> </item> </channel> </rss>