简体   繁体   English

安装过程中ubuntu上的Opencv2.4编译错误

[英]Opencv2.4 compiling error on ubuntu during installation

I'm new with opencv.I'm trying to install opencv24using the script and with out it (manually building everything) and everything I get the same error even though it says done; 我是opencv的新手。我正在尝试使用脚本安装opencv24,但没有安装脚本(手动构建所有内容),即使我说完成,也遇到相同的错误。 it doesn't do anything. 它什么也没做。 Could you help me? 你可以帮帮我吗? Thanks 谢谢

**[ 33%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
/home/pc/OpenCV/opencv-2.4.10/modules/core/src/system.cpp: In function ‘(static initializers for /home/pc/OpenCV/opencv-2.4.10/modules/core/src/system.cpp)’:
/home/pc/OpenCV/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an ‘asm’
         );
          ^
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2**
sudo: checkinstall: command not found
OpenCV 2.4.10 ready to be used

Read this bug report It seems to report having the same type of error. 阅读此错误报告似乎报告存在相同类型的错误。 Apparently old gcc compilers have an issue with some asembly code. 显然,旧的gcc编译器在某些汇编代码方面存在问题。

**/home/ubuntu/opencv/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an ‘asm’
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2**

Could you do a gcc --version If it's something around 4.7, 4.8 That's ok. 你能做一个gcc --version如果它在4.7,4.8左右就可以了。 If it's not, although I would find that strange, could you do a 如果不是,尽管我会觉得很奇怪,但您能

sudo apt-get update
sudo apt-get build-essentials checkinstall

Like Aidana Kane recommended. 像凯达(Aidana Kane)推荐的那样。 You could be using old package lists, and could easily get no new software installed\\updated up to date etc report. 您可能正在使用旧的软件包列表,并且可能很容易no new software installed\\updated up to date报告等。 If even after you've done the sudo apt-get update it still doesn't work, try installing gcc-4.8 explicitly. 如果即使在完成sudo apt-get update后仍然无法正常工作,请尝试显式安装gcc-4.8

I would recommend that solution, updating to newer gcc, rather than monkeypathching the files. 我会建议该解决方案,将其更新为较新的gcc,而不是对文件进行monkeypathching。 However, the bug has been reported fixed in OpenCV version 2.4.11 so you could try and get that one from the git repo. 但是,该错误已报告在OpenCV 2.4.11版本中已修复,因此您可以尝试从git repo中获取该错误。 Or even something "more drastic" as making sure you edit your file system.cpp to look exactly like this one. 甚至是“更加激烈”的操作,以确保您编辑文件system.cpp使其看起来完全这样

确保您已经安装了checkinstall :)

sudo apt-get install build-essential checkinstall

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM