gpt4 book ai didi

opencv - 在 CentOS 5 上构建 OpenCV 2.0 时遇到问题?

转载 作者:太空宇宙 更新时间:2023-11-03 21:23:06 25 4
gpt4 key购买 nike

我一直在尝试将 OpenCV 库安装到我的 centos 系统,但是当我在使用 cmake 配置后键入 make 并按回车键时,出现以下错误:

[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/amoments.o
[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/affine3d_estimator.o
[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/acontours.o
[100%] Building CXX object tests/cv/CMakeFiles/cvtest.dir/src/areprojectImageTo3D.o
Linking CXX executable ../../bin/cvtest
CMakeFiles/cvtest.dir/src/highguitest.o: In function `CV_HighGuiTest::run(int)':
highguitest.cpp:(.text._ZN14CV_HighGuiTest3runEi+0x15): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
[100%] Built target cvtest
make: *** [all] Error 2

有趣的是,一旦我得到这个错误:

[ 99%] Built target mltest
[ 99%] Generating generated0.i
Traceback (most recent call last):
File "/home/proje/OpenCV-2.1.0/interfaces/python/gen.py", line 43, in ?
if True in has_init and not all(has_init[has_init.index(True):]):
NameError: name 'all' is not defined
make[2]: *** [interfaces/python/generated0.i] Error 1
make[1]: *** [interfaces/python/CMakeFiles/cvpy.dir/all] Error 2
make: *** [all] Error 2

这些错误的可能原因是什么?我需要立即在此计算机上安装 opencv。

最佳答案

我遇到了这个问题……是 Python 接口(interface)……默认情况下,Python 2.4 安装在 CentOS 上,要升级到 >2.6 并不容易。

OpenCV 构建时,会被 Python 版本混淆...

所以我在“cmake”上禁用了 Python 接口(interface),一切正常。

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=NO ..

但是,您当然不能再将 OpenCV 与 Python 一起使用了。

关于opencv - 在 CentOS 5 上构建 OpenCV 2.0 时遇到问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2845640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com