../lib/libStructureSLAM.so:对‘cv::line_descriptor::drawKeylines(cv::Mat const&, std::vector<cv::line_

问题:

../lib/libStructureSLAM.so:对‘cv::line_descriptor::drawKeylines(cv::Mat const&, std::vector<cv::line_descriptor::KeyLine, std::allocator<cv::line_descriptor::KeyLine> > const&, cv::Mat&, cv::Scalar_<double> const&, int)’未定义的引用
../lib/libStructureSLAM.so:对‘cv::line_descriptor::LSDDetector::createLSDDetector()’未定义的引用
../lib/libStructureSLAM.so:对‘cv::line_descriptor::LSDDetector::detect(cv::Mat const&, std::vector<cv::line_descriptor::KeyLine, std::allocator<cv::line_descriptor::KeyLine> >&, int, int, cv::Mat const&)’未定义的引用
../lib/libStructureSLAM.so:对‘cv::line_descriptor::BinaryDescriptor::compute(cv::Mat const&, std::vector<cv::line_descriptor::KeyLine, std::allocator<cv::line_descriptor::KeyLine> >&, cv::Mat&, bool) const’未定义的引用
../lib/libStructureSLAM.so:对‘cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor()’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/Structure-SLAM.dir/build.make:375: recipe for target '../Examples/Structure-SLAM' failed
make[2]: *** [../Examples/Structure-SLAM] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Structure-SLAM.dir/all' failed
make[1]: *** [CMakeFiles/Structure-SLAM.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

分析:

这些错误表明链接器无法找到对 cv::line_descriptor 中某些函数的定义。这可能是因为编译器找不到相关的库或者相关的库未正确链接。

要解决这个问题,你需要确保以下几点:

  1. 确保你的项目正确链接了 OpenCV 库,并且链接器能够找到这些库的位置。

  2. 确保你的 OpenCV 版本包含了 cv::line_descriptor 相关的功能。某些版本的 OpenCV 可能没有包含这些功能,或者需要额外的配置或安装选项。

  3. 如果你是在使用 CMake 进行编译,确保你的 CMakeLists.txt 文件正确设置了 OpenCV 相关的路径和库。

  4. 检查是否存在编译器或链接器相关的错误,例如是否有警告指示缺失的库或路径。

通过检查以上几点,你应该能够找到并解决这个链接错误。

解决:

target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS} -lopencv_line_descriptor
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
${PCL_LIBRARIES}
        )

总结:

真是个蠢蛋啊,同样的问题没有看出来,无语住了

  • 7
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值