Ошибка компиляции при включении одиночного заголовка posix_time.hpp boost

Я столкнулся с кажущейся непроходимой ошибкой компиляции, связанной с Boost, которую я сократил до включения одного заголовочного файла Boost. При компиляции (с GCC 4.2 на Mac OS X 10.6.8) пустой файл, содержащий только это, включает:

#include "boost/date_time/posix_time/posix_time.hpp"

…генерирует эти ошибки:

 In file included from ../../../Boost Libraries/Boost_1_55_0/boost/type_traits/has_left_shift.hpp:43,
from ../../../Boost Libraries/Boost_1_55_0/boost/lexical_cast.hpp:165,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/string_parse_tree.hpp:13,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/period_parser.hpp:14,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/date_facet.hpp:23,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/gregorian/gregorian_io.hpp:16,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/gregorian/gregorian.hpp:31,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/time_formatters.hpp:12,
from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/posix_time.hpp:24,
from /Users/homedir/dev/TheProject/Mac/Xcode/../Source/feature/test.cpp:12:
../../../Boost Libraries/Boost_1_55_0/boost/type_traits/detail/has_binary_operator.hpp:155: error: expected unqualified-id before 'do'
In file included from ../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/posix_time.hpp:34,
from /Users/homedir/dev/TheProject/Mac/Xcode/../Source/feature/test.cpp:12:
../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/time_parsers.hpp:40: error: expected `}' at end of input
../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/time_parsers.hpp:40: error: expected unqualified-id at end of input
../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/time_parsers.hpp:40: error: expected `}' at end of input
../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/time_parsers.hpp:40: error: expected `}' at end of input
../../../Boost Libraries/Boost_1_55_0/boost/date_time/posix_time/time_parsers.hpp:40: error: expected `}' at end of input

Эти библиотеки Boost используются как «только заголовки» — не собранные.

Есть какие-нибудь подсказки?

2

Решение

Проблема в файле <AssertMacros.h>, который как-то включается.

Он определяет макрос с именем check (и еще один по имени require) которые конфликтуют с именованной функцией check в «boost / type_traits / detail / has_binary_operator.hpp».

Вы можете определить __ASSERTMACROS__ чтобы этого не случилось.

FWIW, в Mac OS X 10.7 и более поздних версиях Apple переименовала эти макросы в __check и т.д., чтобы предотвратить эту проблему.

1

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector