Pcl内存分配std::bad_alloc问题

T

terminate called after throwing an instance of 'std::bad_alloc’问题

W

出问题的程序段

using PointT=pcl::PointXYZ;
using PclT=pcl::PointCloud<PointT>;
PclT::Ptr res;
pcl::ConditionalRemoval<PointT> condrem;
            condrem.setCondition(range_and);
            condrem.setInputCloud(pcIn);
            res.reset(new PclT());
            condrem.filter(*res);

编译时警告

/usr/bin/ld: warning: libpcl_filters.so.1.8, 
needed by ../../../perceptor/lib/libperceptor.so, 
may conflict with libpcl_filters.so.1.10

注意版本冲突,没有在link_directories连接指定的库


link_directories(LIB_DIR/third_libs/pcl/lib)

改过来就好了

你可能感兴趣的:(c++,linux)