已解决

CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/stereoVision.dir/all' failed

Makefile:83:recipe for target 'all' failed

CMakeFiles/stereoVision.dir/build.make:62: recipe for target 'CMakeFiles/stereoVision.dir/stereoVision.cpp.o' failed
make[2]: *** [CMakeFiles/stereoVision.dir/stereoVision.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/stereoVision.dir/all' failed
make[1]: *** [CMakeFiles/stereoVision.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

问题:

解决办法就是:查看你的cmake .. 后上面的一些错误提示和警告,基本上是CMakeLists.txt中的一些库是否链接好了

例如我当时的CMakeLists.txt:

set(CMAKE_CXX_FLAGS"-std=c++11")
cmake_minimum_required(VERSION 3.10)

project(stereoVision)
find_package(OpenCV REQUIRED)

#添加头文件
include_directories(${OpenCV_INCLUDE_DIRS})

find_package(Pangolin REQUIRED)
include_directories(${Pangolin_INCLUDE_DIRS})

# 链接OpenCV库
add_executable(stereoVision stereoVision.cpp)
target_link_libraries(stereoVision ${OpenCV_LIBS} ${Pangolin_LIBRARIES})

 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐