C2079 “pcl::KdTreeFLANN...param_k_”使用未定义的 struct“flann::SearchParams”

博客指出OpenCV与PCL同时加载会出现问题,原因可能是二者中的flann冲突。解决办法是将属性中与PCL flann有关的内容,如包含目录、库目录、附加依赖项等,放在与OpenCV有关内容的前面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原因:
opencv与pcl同时加载会出现这个问题,原因可能是opencv中的flann与pcl中的flann冲突。
解决办法:
属性->VC++目录–>包含目录属性->VC++目录–>库目录链接器->输入->附加依赖项中的与PCL flann有关的内容放在与opencv有关内容的前面即可。

[100%] Built target ego_planner_node /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o: in function `RandomMapGenerate()': /home/dxinl/Fast-Drone-250/src/uav_simulator/map_generator/src/random_forest_sensing.cpp:152: undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o: in function `RandomMapGenerateCylinder()': /home/dxinl/Fast-Drone-250/src/uav_simulator/map_generator/src/random_forest_sensing.cpp:269: undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x10): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x28): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::nearestKSearch(pcl::PointXYZ const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const' collect2: error: ld returned 1 exit status make[2]: *** [uav_simulator/map_generator/CMakeFiles/random_forest.dir/build.make:329:/home/dxinl/Fast-Drone-250/devel/lib/map_generator/random_forest]
03-13
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值