1

Boost Library を使用して Cilk++ コードをコンパイル中に問題が発生しました。

  1. Boost ライブラリは /usr/include の外にインストールされています。

-I オプションを使用して、cilk++ でコンパイルする際にブースト ディレクトリを指定しました。次のエラーが表示されます。

 /home/user/boost_1_51_0/boost/multi_array.hpp: In member function
 ‘boost::multi_array<T, NumDims, Allocator>& cilk boost::multi_array<T,
 NumDims, Allocator>::resize(const
 boost::detail::multi_array::extent_gen<NumDims>&) [with T = float,
 long unsigned int NumDims = 2ul, Allocator = std::allocator<float>]’:
 kdtree2.h:95: instantiated from here
 /home/user/boost_1_51_0/boost/multi_array.hpp:415: error: no matches
 converting function ‘min’ to type ‘const
 boost::multi_array_types::size_type& (cilk*)(const
 boost::multi_array_types::size_type&, const
 boost::multi_array_types::size_type&)’
 /home/user/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../include/c++/4.2.4/bits/stl_algobase.h:182:
 error: candidates are: template<class _Tp> const _Tp& std::min(const
 _Tp&, const _Tp&) /home/user/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../include/c++/4.2.4/bits/stl_algobase.h:226:
 error: template<class _Tp, class _Compare> const _Tp& std::min(const
 _Tp&, const _Tp&, _Compare)
4

1 に答える 1

0

この問題は、コンパイル中に -isystem オプションを使用することで解決されました。

于 2012-12-02T17:20:32.430 に答える