Raspberry Pi 中的非法指令 [英] Illegal instruction in Raspberry Pi

查看:39
本文介绍了Raspberry Pi 中的非法指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天编译了从github下载的opencv-master.随着网页http://ariandy1.wordpress.com/2013/02/13/raspberry-pi-rasbian-opencv/中的这些说明,最后编译了OpenCV成功地.但是当我写了一个简单的 C++ 程序时,将它与 -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_video 链接,在终端中运行它.Illegal instructions 说发生了错误.但是当我把OpenCV依赖的代码去掉,重新编译后,就可以成功运行了.我怀疑 apt-get 安装的包有一些错误.但我找不到他们.有人面临这个问题吗?

Today, I compiled the opencv-master downloaded from github. With these instructions in the webpage http://ariandy1.wordpress.com/2013/02/13/raspberry-pi-rasbian-opencv/, and finally the OpenCV compiled successfully. But when I wrote a simple C++ program, link it with the -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_video, run it in terminal. An error occured, says Illegal instruction. But when I remove the OpenCV-dependent code, and recompile, it can run successfully. I doubt that the packages installed by apt-get have some bugs. But I can't find them. Does anyone face this problem?

/etc/apt/sources.list 是:

    deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
    deb http://www.deb-multimedia.org/ wheezy main non-free
    deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
    deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free

更新

dmesg 的输出是:http://pastebin.com/dsr8mgVY

更新 2

ldd 命令的输出是:http://pastebin.com/s7sUQAbk

更新 3

'file' 命令的输出是:http://pastebin.com/Q1eaYtjk

The output of 'file' command is: http://pastebin.com/Q1eaYtjk

推荐答案

我不知道 Raspberry Pi 中的非法指令 的确切原因,但我找到了解决方案.只需使用 -DWITH_FFMPEG:BOOL='0' 重新编译 OpenCV.如果没有 ffmpeg,摄像机仍然可以工作.

I don't know the exact reasons of the Illegal instruction in Raspberry Pi, but I find a solution. Just recompile OpenCV with -DWITH_FFMPEG:BOOL='0'. Without the ffmpeg, the video camera still works.

这篇关于Raspberry Pi 中的非法指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆