1.make时报错:
CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o: In function `fmt::v8::appender fmt::v8::detail::write<char, fmt::v8::appender>(fmt::v8::appender, fmt::v8::basic_string_view<fmt::v8::type_identity<char>::type>, fmt::v8::basic_format_specs<char> const&, fmt::v8::detail::locale_ref) [clone .isra.1336]':
pose_estimation_3d3d.cpp:(.text+0x68c7): undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
等等 有关 In function `fmt 的问题,就是说明,没有链接到fmt,我们只需要在cmakelist.txt中加入fmt 链接即可,方法如下:
在报错的cpp文件位置 下面加入 ${FMT_LIBRARIES} fmt,最后两部分修改后如下:
add_executable(pose_estimation_3d2d pose_estimation_3d2d.cpp)
target_link_libraries(pose_estimation_3d2d
g2o_core g2o_stuff
${OpenCV_LIBS}
${FMT_LIBRARIES} fmt)
add_executable(pose_estimation_3d3d pose_estimation_3d3d.cpp)
target_link_libraries(pose_estimation_3d3d
g2o_core g2o_stuff
${OpenCV_LIBS}
${FMT_LIBRARIES} fmt)
2.cmake ..时 报错:
CMake Error at CMakeLists.txt:9 (add_executable):
Target "useSophus" links to target "Sophus::Sophus" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
解决方案:
在CMakeLists.txt中:加入
set(Sophus_DIR "/home/你自己的路径/Sophus/build")
重新编译: 搞定!
3.运行问题
3.1 ./orb_cv 报错提示 usage: feature_extraction img1 img2
因为img1和img2的位置需要你自己输入,因此输入命令:
./orb_cv ../1.png ../2.png
3.2 ./orb_self 找不到图片路径
将源码相对路径修改为:
string first_file = "../1.png";
string second_file = "../2.png";
或者直接改成你自己的绝对路径也行,保存后重新编译,再次运行 ./orb_self
3.3 ./pose_estimation_2d2d 或 ./triangulation 或./pose_estimation_3d2d 或./pose_estimation_3d3d
报错提示 usage: feature_extraction img1 img2
一样在命令后加入 ../1.png ../2.png 即可