我正在使用Ubuntu 12.04和gcc 4.8,我的gfortran刚刚更新到4.8,有些我无法编译它,这里是错误:
In file included from /home/rtbkit/local/include/boost/tuple/tuple.hpp:33:0,
from ./jml/boosting/tools/boosting_tool_common.h:16,
from ./jml/boosting/tools/boosting_tool_common.cc:10:
/home/rtbkit/local/include/boost/tuple/detail/tuple_basic.hpp: In function 'typename boost::tuples::access_traits<typename boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::const_type boost::tuples::get(const boost::tuples::cons<HT, TT>&)':
/home/rtbkit/local/include/boost/tuple/detail/tuple_basic.hpp:228:31: error: typedef 'cons_element' locally defined but not used [-Werror=unused-local-typedefs]
typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
^
In file included from /home/rtbkit/local/include/boost/multi_array/concept_checks.hpp:21:0,
from /home/rtbkit/local/include/boost/multi_array/base.hpp:28,
from /home/rtbkit/local/include/boost/multi_array.hpp:21,
from ./jml/boosting/classifier.h:20,
from ./jml/boosting/tools/boosting_tool_common.cc:14:
/home/rtbkit/local/include/boost/concept_check.hpp: In function 'void boost::function_requires (Model*)':
/home/rtbkit/local/include/boost/concept_check.hpp:45:113: error: typedef 'boost_concept_check45' locally defined but not used [-Werror=unused-local-typedefs]
BOOST_CONCEPT_ASSERT((Model));
^
typedef typename Array::index_range index_range;
^
/home/rtbkit/local/include/boost/multi_array/concept_checks.hpp:43:37: error: typedef 'index' locally defined but not used [-Werror=unused-local-typedefs]
typedef typename Array::index index;
^
/home/rtbkit/local/include/boost/multi_array/concept_checks.hpp: In static member function 'static void boost::multi_array_concepts::detail::idgen_helper<0ul>::call(Array&, const IdxGen&, Call_Type)':
^
In file included from /home/rtbkit/local/include/boost/regex/v4/regex.hpp:79:0,
from /home/rtbkit/local/include/boost/regex.hpp:31,
from ./jml/boosting/tools/boosting_tool_common.cc:18:
/home/rtbkit/local/include/boost/regex/v4/regex_format.hpp: In member function 'OutputIter boost::re_detail::format_functor_c_string<charT, Match, Traits>::operator()(const Match&, , boost::regex_constants::match_flag_type, const Traits&)':
/home/rtbkit/local/include/boost/regex/v4/regex_format.hpp:1086:41: error: typedef 'char_type' locally defined but not used [-Werror=unused-local-typedefs]
typedef typename Match::char_type char_type;
^
In file included from /home/rtbkit/local/include/boost/regex/v4/regex.hpp:166:0,
from /home/rtbkit/local/include/boost/regex.hpp:31,
from ./jml/boosting/tools/boosting_tool_common.cc:18:
/home/rtbkit/local/include/boost/regex/v4/regex_split.hpp: In function 'std::size_t boost::regex_split(OutputIterator, std::basic_string<charT, Traits1, Alloc1>&, const boost::basic_regex<charT, Traits2>&, boost::regex_constants::match_flag_type, std::size_t)':
/home/rtbkit/local/include/boost/regex/v4/regex_split.hpp:110:57: error: typedef 'match_allocator' locally defined but not used [-Werror=unused-local-typedefs]
typedef typename match_results<ci_t>::allocator_type match_allocator;
^
cc1plus: all warnings being treated as errors
make: *** [build/x86_64/obj/jml/boosting/tools/boosting_tool_common.3ec7a8f7cea9a8b0de95729f9e9210cd.lo] Error 1
我的图书馆有什么问题?我检查了gfortran的版本是4.8。
答案 0 :(得分:3)
使用GCC 4.8编译rtbkit时会发生此错误。
最后为我工作:
nano /home/rtbkit/rtbkit/Makefile
将编译器标志 -Wno-unused-local-typedefs 添加到CXXFLAGS
CXXFLAGS += -Wno-unused-local-typedefs -Wno-deprecated ...