在Ubuntu 16.04 LTS上使用VTK安装opencv3.4.1

时间:2018-03-12 12:05:25

标签: opencv ubuntu ubuntu-16.04 opencv3.0 vtk

我尝试在Ubuntu上使用VTK安装opencv。实际上我只成功安装了opencv。但是当我完成make VTK并试图制作opencv时,我在安装viz模块时遇到以下错误。

> [ 71%] Building CXX object
> modules/viz/CMakeFiles/opencv_viz.dir/src/clouds.cpp.o
> /home/ycdfwzy/Documents/opencv-3.4.1/modules/viz/src/clouds.cpp: In
> constructor ‘cv::viz::WMesh::WMesh(const cv::viz::Mesh&)’:
> /home/ycdfwzy/Documents/opencv-3.4.1/modules/viz/src/clouds.cpp:447:16:
> error: invalid use of incomplete type ‘class vtkTexture’
>          texture->SetInputConnection(image_source->GetOutputPort());
>                 ^ In file included from /usr/local/include/vtk-9.0/vtkFollower.h:36:0,
>                  from /home/ycdfwzy/Documents/opencv-3.4.1/build/modules/viz/precomp.hpp:86:
> /usr/local/include/vtk-9.0/vtkActor.h:41:7: note: forward declaration
> of ‘class vtkTexture’  class vtkTexture;
>        ^ In file included from /usr/local/include/vtk-9.0/vtkGenericDataArray.h:70:0,
>                  from /usr/local/include/vtk-9.0/vtkAOSDataArrayTemplate.h:35,
>                  from /usr/local/include/vtk-9.0/vtkIntArray.h:33,
>                  from /usr/local/include/vtk-9.0/vtkCellTypes.h:42,
>                  from /usr/local/include/vtk-9.0/vtkPolyData.h:64,
>                  from /usr/local/include/vtk-9.0/vtkPolyDataAlgorithm.h:36,
>                  from /usr/local/include/vtk-9.0/vtkAppendPolyData.h:35,
>                  from /home/ycdfwzy/Documents/opencv-3.4.1/build/modules/viz/precomp.hpp:56:
> /usr/local/include/vtk-9.0/vtkSmartPointer.h: In instantiation of
> ‘static vtkSmartPointer<T> vtkSmartPointer<T>::New() [with T =
> vtkTexture]’:
> /home/ycdfwzy/Documents/opencv-3.4.1/modules/viz/src/clouds.cpp:446:76:
> required from here
> /usr/local/include/vtk-9.0/vtkSmartPointer.h:155:37: error: incomplete
> type ‘vtkTexture’ used in nested name specifier
>      return vtkSmartPointer<T>(T::New(), NoReference());
>                                      ^ /usr/local/include/vtk-9.0/vtkSmartPointer.h: In instantiation of ‘T*
> vtkSmartPointer<T>::operator->() const [with T = vtkTexture]’:
> /home/ycdfwzy/Documents/opencv-3.4.1/modules/viz/src/clouds.cpp:447:16:
> required from here
> /usr/local/include/vtk-9.0/vtkSmartPointer.h:130:40: error: invalid
> static_cast from type ‘vtkObjectBase* const’ to type ‘vtkTexture*’
>      return static_cast<T*>(this->Object);
>                                         ^ /usr/local/include/vtk-9.0/vtkSmartPointer.h: In instantiation of
> ‘vtkSmartPointer<T>::operator T*() const [with T = vtkTexture]’:
> /home/ycdfwzy/Documents/opencv-3.4.1/modules/viz/src/clouds.cpp:448:34:
> required from here
> /usr/local/include/vtk-9.0/vtkSmartPointer.h:113:40: error: invalid
> static_cast from type ‘vtkObjectBase* const’ to type ‘vtkTexture*’
>      return static_cast<T*>(this->Object);
>                                         ^ modules/viz/CMakeFiles/opencv_viz.dir/build.make:62: recipe for target
> 'modules/viz/CMakeFiles/opencv_viz.dir/src/clouds.cpp.o' failed
> make[2]: *** [modules/viz/CMakeFiles/opencv_viz.dir/src/clouds.cpp.o]
> Error 1 CMakeFiles/Makefile2:4082: recipe for target
> 'modules/viz/CMakeFiles/opencv_viz.dir/all' failed make[1]: ***
> [modules/viz/CMakeFiles/opencv_viz.dir/all] Error 2 Makefile:160:
> recipe for target 'all' failed make: *** [all] Error 2

有没有人遇到过类似的问题?我该如何解决这个问题?

0 个答案:

没有答案