问题
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