Заголовок Boost 1.61 пытается переопределить mpl _ :: bool_ - PullRequest
0 голосов
/ 11 декабря 2018

Я на Boost 1.61 и компилирую с clang 4.0.1, и я компилирую для linux-gnu

Раньше я был на Boost 1.52 и у меня не было этой проблемы.Просто меняя версии, я получаю сообщение об ошибке компилятора о переопределении mpl_::bool_

Я не использую предварительно скомпилированные библиотеки повышения.Это только заголовки.

Это мое включение и единственное включение повышения:

#include <system/math/math.h>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>

Я получаю ошибку компилятора:

1>  In file included from myfile.cpp:9:
1>  In file included from boost_1_61_0\boost/interprocess/managed_shared_memory.hpp:25:
1>  In file included from boost_1_61_0\boost/interprocess/detail/managed_memory_impl.hpp:30:
1>  In file included from boost_1_61_0\boost/interprocess/segment_manager.hpp:38:
1>  In file included from boost_1_61_0\boost/interprocess/allocators/allocator.hpp:30:
1>  In file included from boost_1_61_0\boost/interprocess/allocators/detail/allocator_common.hpp:32:
1>  In file included from boost_1_61_0\boost/interprocess/sync/scoped_lock.hpp:35:
1>  In file included from boost_1_61_0\boost/interprocess/detail/posix_time_types_wrk.hpp:32:
1>  In file included from boost_1_61_0\boost/date_time/posix_time/ptime.hpp:12:
1>  In file included from boost_1_61_0\boost/date_time/posix_time/posix_time_system.hpp:13:
1>  In file included from boost_1_61_0\boost/date_time/posix_time/posix_time_config.hpp:18:
1>  In file included from boost_1_61_0\boost/date_time/gregorian/gregorian_types.hpp:19:
1>  In file included from boost_1_61_0\boost/date_time/gregorian/greg_calendar.hpp:13:
1>  In file included from boost_1_61_0\boost/date_time/gregorian/greg_weekday.hpp:12:
1>  In file included from boost_1_61_0\boost/date_time/constrained_value.hpp:17:
1>  In file included from boost_1_61_0\boost/type_traits/is_base_of.hpp:12:
1>  In file included from boost_1_61_0\boost/type_traits/is_base_and_derived.hpp:13:
1>  boost_1_61_0\boost/type_traits/integral_constant.hpp:41:21: error: target of using declaration conflicts with declaration already in scope
1>        using ::mpl_::bool_;
1>                      ^
1>  boost_1_61_0\boost/type_traits/integral_constant.hpp:32:29: note: target of using declaration
1>     template <bool B> struct bool_;
1>                              ^
1>  boost_1_61_0\boost/mpl/bool.hpp:23:28: note: conflicting declaration
1>  template< bool C_ > struct bool_

clang isиспользуя эти аргументы: -m64 -fdeclspec -Wall -mcx16 -msse4 -stdlib=libstdc++ -g -ggdb3 -O1 -fno-exceptions -std=c++11 -Wextra -DBOOST_DATE_TIME_NO_LIB

1 Ответ

0 голосов
/ 12 декабря 2018

Обнаружил, что это аналогичная ошибка: https://svn.boost.org/trac10/ticket/12212

Заметил, что я определил это для другой библиотеки, поэтому я не определил его для этого:

#undef BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE
#include <boost/interprocess/managed_shared_memory.hpp>
#define BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE
...