Illegal instruction in Raspberry Pi

孤街醉人 提交于 2020-01-16 10:17:11

问题


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?

The /etc/apt/sources.list is:

    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

UPDATE

The output of dmesg is: http://pastebin.com/dsr8mgVY

UPDATE 2

The output of ldd command is : http://pastebin.com/s7sUQAbk

UPDATE 3

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


回答1:


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.



来源:https://stackoverflow.com/questions/22893597/illegal-instruction-in-raspberry-pi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!