Subject: [Boost-bugs] [Boost C++ Libraries] #7260: Header order conflicts between Thread and ASIO
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-22 04:49:48
#7260: Header order conflicts between Thread and ASIO
--------------------------------------+-------------------------------------
Reporter: joshuadavidson@⦠| Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.52.0
Severity: Problem | Keywords:
--------------------------------------+-------------------------------------
This problem is still present as of 1.50. Link to discussion:
http://lists.boost.org/boost-users/2012/06/74823.php
Consider this following simple app:
#include <boost/thread/thread.hpp>
#include <boost/asio.hpp>
#include <boost/thread/recursive_mutex.hpp>
int main() {
return 0;
}
If you try to build that on Windows, you receive the following error:
In file included from
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/recursive_mutex.hpp:14:0,
from
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/recursive_mutex.hpp:14,
from build.cpp:3:
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:
In member function 'void
boost::detail::basic_recursive_mutex_impl<underlying_mutex_type>::lock()':
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:52:21:
error: '_InterlockedExchange' is not a member of 'boost::detail'
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:
In member function 'void
boost::detail::basic_recursive_mutex_impl<underlying_mutex_type>::unlock()':
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:71:21:
error: '_InterlockedExchange' is not a member of 'boost::detail'
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:
In member function 'bool
boost::detail::basic_recursive_mutex_impl<underlying_mutex_type>::try_basic_lock(long
int)':
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:91:21:
error: '_InterlockedExchange' is not a member of 'boost::detail'
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:
In member function 'bool
boost::detail::basic_recursive_mutex_impl<underlying_mutex_type>::try_timed_lock(long
int, const boost::system_time&)':
c:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/boost/thread/win32/basic_recursive_mutex.hpp:102:21:
error: '_InterlockedExchange' is not a member of 'boost::detail'
If asio.hpp is moved ahead of the thread headers, the error goes away.
Weâve been trying to dictate #include order to work around this problem,
but it keeps cropping up.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7260> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC