我想运行我在网上找到的这个c++/OpenCV代码:
homography.html
我对CMake有问题,它返回了以下错误:
CMake Error at CMakeLists.txt:5 (target_link_libraries):无法为目标"SURF_Homography“指定链接库,该目标”SURF_Homography“不是由该项目构建的。
我在网上搜索了解决方案,我找到了这个
CMake OpenCV Cannot Specify Link Libraries
但是我不明白为什么我的文件不能工作,因为它看起来是一样的,这是我的CMakeLists文件:
cmake_minimum_required(VERSION 2.8)
project( SURF_Homography )
find_package( OpenCV REQUIRED )
add_executable( SURF_Homography.cpp SURF_Homography.cpp )
target_link_libraries( SURF_Homography ${OpenCV_LIBS} )希望你能帮我谢谢卢卡
发布于 2014-05-07 10:48:06
更改add_executable行:
add_executable( SURF_Homography SURF_Homography.cpp )否则,您在target_link_libraries行中指定的目标将不存在:)
https://stackoverflow.com/questions/23515536
复制相似问题