Can‘t Compile project with PCL

22 篇文章 3 订阅

报错:

In file included from /usr/include/vtk/vtkAtomicTypes.h:18:0,
                 from /usr/include/vtk/vtkObjectBase.h:46,
                 from /usr/include/vtk/vtkSmartPointerBase.h:27,
                 from /usr/include/vtk/vtkSmartPointer.h:23,
                 from /usr/include/pcl-1.8/pcl/visualization/point_cloud_geometry_handlers.h:48,
                 from /usr/include/pcl-1.8/pcl/visualization/point_cloud_handlers.h:41,
                 from /usr/include/pcl-1.8/pcl/visualization/common/actor_map.h:40,
                 from /usr/include/pcl-1.8/pcl/visualization/pcl_visualizer.h:48,
                 from /usr/include/pcl-1.8/pcl/visualization/cloud_viewer.h:39,
                 from /home/usr/my_code/pclviewer.h:3,
                 from /home/usr/my_code/stereo.h:8,
                 from /home/usr/my_code/stereo.cpp:1:
/usr/include/vtk/vtkAtomic.h:358:11: error: reference to 'detail' is ambiguous
   typedef detail::AtomicOps<sizeof(T)> Impl;
           ^~~~~~
/usr/include/vtk/vtkAtomic.h:82:11: note: candidates are: namespace detail { }
 namespace detail
           ^~~~~~
In file included from /usr/local/include/opencv2/core/base.hpp:56:0,
                 from /usr/local/include/opencv2/core.hpp:54,
                 from /usr/local/include/opencv2/opencv.hpp:48,
                 from /home/usr/my_code/stereo.h:4,
                 from /home/usr/my_code/stereo.cpp:1:
/usr/local/include/opencv2/core/cvstd.hpp:165:11: note:                 namespace cv::detail { }
 namespace detail
           ^~~~~~
In file included from /usr/include/vtk/vtkAtomicTypes.h:18:0,
                 from /usr/include/vtk/vtkObjectBase.h:46,
                 from /usr/include/vtk/vtkSmartPointerBase.h:27,
                 from /usr/include/vtk/vtkSmartPointer.h:23,
                 from /usr/include/pcl-1.8/pcl/visualization/point_cloud_geometry_handlers.h:48,
                 from /usr/include/pcl-1.8/pcl/visualization/point_cloud_handlers.h:41,
                 from /usr/include/pcl-1.8/pcl/visualization/common/actor_map.h:40,
                 from /usr/include/pcl-1.8/pcl/visualization/pcl_visualizer.h:48,
                 from /usr/include/pcl-1.8/pcl/visualization/cloud_viewer.h:39,
                 from /home/usr/my_code/pclviewer.h:3,
                 from /home/usr/my_code/stereo.h:8,
                 from /home/usr/my_code/stereo.cpp:1:
/usr/include/vtk/vtkAtomic.h:434:12: error: 'Impl' has not been declared
...

解决办法:
头文件里绝对不要使用:using namespace cv; 删去改代码,把所使用这个命名空间的加上cv::。

using namespace cv;
using namespace std;都要慎用,否则会毁掉整个工程。

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值