icc认为boost :: filesystem3 :: path是一个不完整的类型

时间:2014-12-08 03:02:01

标签: c++ templates boost icc incomplete-type

我正在尝试使用icc构建名为Mitsuba的程序。但是当我编译时,我会收到很多错误,说类型不完整。以下是一些例子:

icc -o build/release/libcore/thread.os -c -O3 -Wall -g -pipe -O3 -ipo -no-prec-div -xSSE3 -fp-model fast=2 -openmp -mfpmath=sse -march=nocona -fno-math-errno -fomit-frame-pointer -DMTS_DEBUG -DSINGLE_PRECISION -DSPECTRUM_SAMPLES=3 -DMTS_SSE -DMTS_HAS_COHERENT_RT -fopenmp -fvisibility=hidden -std=c++0x -wd2928 -Qoption,cpp,--rvalue_ctor_is_not_copy_ctor -fPIC -DMTS_BUILD_MODULE=MTS_MODULE_CORE -DMTS_HAS_LIBPNG=1 -DMTS_HAS_LIBJPEG=1 -I/usr/include/OpenEXR -I/u/i/n/ingrassi/eigen -I/usr/include/OpenEXR -Iinclude src/libcore/thread.cpp
/usr/include/c++/4.4.7/bits/stl_deque.h(450): error: incomplete type is not allowed
    _M_impl._Tp_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
                                                                    ^
          detected during:
            instantiation of "void std::_Deque_base<_Tp, _Alloc>::_M_deallocate_node(_Tp *) [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 553
            instantiation of "void std::_Deque_base<_Tp, _Alloc>::_M_destroy_nodes(_Tp **, _Tp **) [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 476
            instantiation of "std::_Deque_base<_Tp, _Alloc>::~_Deque_base() [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 790
            instantiation of "std::deque<_Tp, _Alloc>::~deque() [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 97 of "include/mitsuba/core/fresolver.h"

/usr/include/c++/4.4.7/bits/stl_deque.h(1652): error: an incomplete class type is not allowed
    if (!__has_trivial_destructor(value_type))
         ^
          detected during:
            instantiation of "void std::deque<_Tp, _Alloc>::_M_destroy_data(std::deque<_Tp, _Alloc>::iterator, std::deque<_Tp, _Alloc>::iterator, const std::allocator<_Tp> &) [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 790
            instantiation of "std::deque<_Tp, _Alloc>::~deque() [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 97 of "include/mitsuba/core/fresolver.h"

/usr/include/c++/4.4.7/bits/stl_deque.h(666): error: incomplete type is not allowed
        { return __deque_buf_size(sizeof(_Tp)); }
                                         ^
          detected during:
            instantiation of "size_t={unsigned long} std::deque<_Tp, _Alloc>::_S_buffer_size() [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 728 of "/usr/include/c++/4.4.7/bits/deque.tcc"
            instantiation of "void std::deque<_Tp, _Alloc>::_M_destroy_data_aux(std::deque<_Tp, _Alloc>::iterator, std::deque<_Tp, _Alloc>::iterator) [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 1653
            instantiation of "void std::deque<_Tp, _Alloc>::_M_destroy_data(std::deque<_Tp, _Alloc>::iterator, std::deque<_Tp, _Alloc>::iterator, const std::allocator<_Tp> &) [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 790
            instantiation of "std::deque<_Tp, _Alloc>::~deque() [with _Tp=boost::filesystem3::path, _Alloc=std::allocator<boost::filesystem3::path>]" at line 97 of "include/mitsuba/core/fresolver.h"

我对模板有些新意,但我认为这些说boost :: filesystem3 :: path类型不完整。在检查boost / filesystem / path.hpp时,情况似乎并非如此。

导致此问题的文件(fresolver.h):

#include <mitsuba/mitsuba.h>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <deque>

...

class MTS_EXPORT_CORE FileResolver : public Object {
    ...
private:
    std::deque<fs::path> m_paths;
}

为什么编译失败,我该如何解决?

0 个答案:

没有答案