安装了两个OpenCV(有不同的版本),我不能删除过去的所有痕迹 [英] Two OpenCV's are installed (with different versions) and I can't delete all traces of the past one
问题描述
我是Linux系统的新手,但我真的需要这个项目,所以我真的需要你的帮助。
这是发生了什么:我已经有OpenCV 2.4在linux系统上,我还安装了另一个库libv4l。由于某种原因,此安装后,cmake无法找到OpenCv。所以我这次安装OpenCV 3.0,希望这是一个兼容性问题或某事。
但是,OpenCV 2.4安装在/ usr / lib默认情况下,make,make install)和OpenCV 3.0安装在/ usr / local / lib。
现在当我尝试cmake时,
无法为目标< projectname>生成安全的运行时搜索路径。
,因为某些目录中的文件可能与
隐式目录中的库冲突:
...存在于usr / lib和usr / local / lib中的文件列表
当我忽略警告并继续make时,我得到以下错误:
没有规则使目标< an opencv file>
my CMakeLists如下:
cmake_minimum_required(version 2.8)
project(camera_test)
find_package(OpenCV 3.0.0)#also试过没有3.0.0
set CMAKE_MODULE_PATHusr / local / lib / cmake / $ {CMAKE_MODULE_PATH})
find_package(raspicam REQUIRED)
target_link_libraries(camera_test $ {raspicam_LIBS})
target_link_libraries(camera_test $ {opencv_LIBS})
我认为我的问题与以下页面相同:
http ://answers.opencv.org/question/52921/how-to-uninstall-opencv249-completely-in-ubuntu-1404/
但是在这里是最后一个catch:
我为openCV 3.0做了make uninstall,然后使用
sudo find / -name* opencv *-exec rm {} \;
并重新安装openCV 3.0
它没有解决我的问题。它仍然认为在usr / lib有文件,虽然我找不到任何文件了。
请给我建议一个解决方案,如果你能告诉我我这个东西的逻辑。我的意思是,它是如何知道有一个安装opencv在usr / lib,我离开什么跟踪?在这种情况下,我需要寻找/执行的基本文件/命令是什么。
非常感谢您的帮助。
编辑:以下是完整的CMakeLists文件:
cmake_minimum_required(VERSION 2.8)
project(raspicam_test)
find_package(OpenCV 3.0.0)
set(CMAKE_MODULE_PATH/ usr / local / lib / cmake / $ {CMAKE_MODULE_PATH})
find_package需要)
IF(OpenCV_FOUND和raspicam_CV_FOUND)
MESSAGE(状态COMPILING OPENCV TESTS)
add_executable(simpletest_raspicam_cv simpletest_raspicam_cv.cpp)
target_link_libraries(simpletest_raspicam_cv $ {raspicam_CV_LIBS }
target_link_libraries(simpletest_raspicam_cv $ {OpenCV_LIBS})
ELSE()
MESSAGE(FATAL_ERROROPENCV NOT FOUND IN YOUR SYSTEM)
ENDIF()
可能的原因:
sudo find / -name* opencv *-exec rm {} \;
不会删除目录。但在
中有一些cmake文件/ usr / share / opencv
pre>
因此不会被删除,包含您以前的OpenCV安装的已弃用的信息。
如果这些文件存在于您的文件系统中?
I am new to Linux systems but I really need this for my project, so I really need your help.
Here is what happened: I have had OpenCV 2.4 on a linux system and I also installed another library called libv4l. For some reason after this install, cmake was unable to find OpenCv. So I installed OpenCV 3.0 this time, hoping that it was a compatibility problem or something.
However, OpenCV 2.4 was installed at /usr/lib by default (I used cmake, make, make install) and OpenCV 3.0 was installed at /usr/local/lib.
Now when I try to cmake, I get this warning:
Cannot generate a safe runtime search path for target <projectname> because files in some directories may conflict with libraries in implicit directories: ...list of files that exist both in usr/lib and usr/local/lib
and when I ignore the warning and proceed with make, I get the following error:
No rule to make target <an opencv file>
my CMakeLists is as follows:
cmake_minimum_required (version 2.8) project(camera_test) find_package(OpenCV 3.0.0) #also tried without 3.0.0 set(CMAKE_MODULE_PATH "usr/local/lib/cmake/${CMAKE_MODULE_PATH}") find_package(raspicam REQUIRED) target_link_libraries (camera_test ${raspicam_LIBS}) target_link_libraries (camera_test ${opencv_LIBS})
I think my problem is the same with the following pages:
Removing all installed OpenCV libs
http://answers.opencv.org/question/52921/how-to-uninstall-opencv249-completely-in-ubuntu-1404/
However here is the final catch:
I did "make uninstall" for openCV 3.0, then used
sudo find / -name "*opencv*" -exec rm {} \;
and re installed openCV 3.0
but it did not fix my problem. It still thinks there are files at usr/lib although I cant find any files there anymore.
Please suggest me a solution, and I would really appreciate if you can tell briefly me the logic of this thing. I mean, How does it know there was an installed opencv at usr/lib, what trace did I leave? What are the essential files/commands I need to be looking for/executing in such cases.
Thanks a lot, I really appreciate your help.
Edit: Here is the complete CMakeLists file:
cmake_minimum_required (VERSION 2.8) project (raspicam_test) find_package(OpenCV 3.0.0) set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/${CMAKE_MODULE_PATH}") find_package(raspicam REQUIRED) IF ( OpenCV_FOUND AND raspicam_CV_FOUND ) MESSAGE(STATUS "COMPILING OPENCV TESTS") add_executable (simpletest_raspicam_cv simpletest_raspicam_cv.cpp) target_link_libraries (simpletest_raspicam_cv ${raspicam_CV_LIBS} ) target_link_libraries (simpletest_raspicam_cv ${OpenCV_LIBS}) ELSE() MESSAGE(FATAL_ERROR "OPENCV NOT FOUND IN YOUR SYSTEM") ENDIF()
解决方案Possible cause:
sudo find / -name "*opencv*" -exec rm {} \;
won't delete directories. But there are some cmake files in
/usr/share/opencv
which would therefore not be deleted, containing deprecated infos to your previous OpenCV install.
Can you check if these files exist in your filesystem?
这篇关于安装了两个OpenCV(有不同的版本),我不能删除过去的所有痕迹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!