程序退出代码132

时间:2014-06-08 08:38:49

标签: c++ opencv raspberry-pi raspbian

我正在使用raspbian,opencv-2.4.8和geany这是我的简单/第一个代码

#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
using namespace std;
using namespace cv;
int main ()
{
    Mat image=imread("/home/pi/Desktop/pic3.png");
    if (! image.data)
    {
        cout<<"error"<<endl;
    }
    else
    {
        namedWindow("display",WINDOW_AUTOSIZE)
        imshow("display",image);
        waitKey(0);
        return 0;
    }
}    

这些是geany-&gt; project-&gt; properties-&gt; build

中的编译和构建命令
g++ $(pkg-config --cflags opencv-2.4.8) -c "f'
g++ $(pkg-config --clfags --libs opencv-2.4.8) -o "e" "f'

它完美地编译和构建,但是当我执行它时,这是我的输出

非法指导


(程序退出代码:132)

我在互联网上搜索了这个退出代码,但找不到单个帖子或关于它的问题

1 个答案:

答案 0 :(得分:8)

132 = 128 + 4

man退出:

>128   A command was interrupted by a signal.

man -s 7 signal

SIGILL        4       Core    Illegal Instruction

<强>后来

-I/usr/local/include -I/usrlocal/include/opencv对于仅编译(-c)调用有意义(但不适用于链接可执行文件的第二个g++调用)。但是库的完整路径并未指定库。您通常做的是为每个目录指定一个-L/usr/local/lib(或类似),并为这些目录中的每个库指定-lopencv_calib3d(或类似)(省略lib和{{1} }。)

相关问题