Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Общие вопросы > boost-1.41 и gcc-4.5


Автор: andrew_121 6.2.2010, 17:27
хай!

установил новую версию компилятора, и в бусте "появились" ошибки. но я не понимаю, что за ошибки, и как исправить.
пример:
Цитата

/usr/include/boost/date_time/date_formatting.hpp: In static member function ‘static std::basic_string<charT> boost::date_time::ymd_formatter<ymd_type, format_type, charT>::ymd_to_string(ymd_type)’:
/usr/include/boost/date_time/date_formatting.hpp:87:36: ошибка: cannot call constructor ‘std::locale::locale’ directly
/usr/include/boost/date_time/date_formatting.hpp:87:36: ошибка: for a function-style cast, remove the redundant ‘::locale’
/usr/include/boost/date_time/date_formatting.hpp: In static member function ‘static std::basic_string<charT> boost::date_time::ymd_formatter<ymd_type, format_type, charT>::ymd_to_string(ymd_type) [with ymd_type = boost::date_time::year_month_day_base<boost::gregorian::greg_year, boost::gregorian::greg_month, boost::gregorian::greg_day>, format_type = boost::date_time::simple_format<char>, charT = char]’:
/usr/include/boost/date_time/date_formatting.hpp:124:76: instantiated from ‘static boost::date_time::date_formatter<date_type, format_type, charT>::string_type boost::date_time::date_formatter<date_type, format_type, charT>::date_to_string(date_type) [with date_type = boost::gregorian::date, format_type = boost::date_time::simple_format<char>, charT = char, boost::date_time::date_formatter<date_type, format_type, charT>::string_type = std::basic_string<char>]’
/usr/include/boost/date_time/gregorian/formatters.hpp:34:99: instantiated from ‘std::basic_string<_CharT> boost::gregorian::to_simple_string_type(const boost::gregorian::date&) [with charT = char]’
/usr/include/boost/date_time/gregorian/formatters.hpp:40:41: instantiated from here

Автор: jonie 6.2.2010, 18:11
вышел 1.42... попробуй обновиться (а вдруг?)....

Автор: andrew_121 6.2.2010, 18:23
Цитата(jonie @  6.2.2010,  18:11 Найти цитируемый пост)
вышел 1.42... попробуй обновиться (а вдруг?).... 

вариант. но хотелось бы понять в чем разница. все же 4.5 это первая версия поддерживающая c++0x очень сильно.

Автор: jonie 6.2.2010, 18:44
   * patches/date_time_date_formatting_hpp.patch: Change
     std::locale::locale() to std::locale().  Closes: #564863.
меняй, баг известный судя по гуглу
(это из патчей дебиана)

Автор: andrew_121 6.2.2010, 18:48
jonie, спасибо!
я даже не гуглил. т.к. не думал что этот баг уже всплыл.

Автор: bsa 7.2.2010, 22:23
Цитата(andrew_121 @  6.2.2010,  18:48 Найти цитируемый пост)
я даже не гуглил. т.к. не думал что этот баг уже всплыл. 
А зря. Подобные вещи всплывают моментально. Кстати, очень помогает открытие исходников буста и попытка исправить ошибку. Пару раз такое лично проделывал.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)