Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

program exited with code 132

i am using raspbian,opencv-2.4.8 and geany this is my simple/first code

#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;
    }
}    

these are compile and build commands in geany->project->properties->build

g++ $(pkg-config --cflags opencv-2.4.8) -c "f'
g++ $(pkg-config --clfags --libs opencv-2.4.8) -o "e" "f'

and it compiles and build perfectly but when i execute it this is my output

Illegal instruction


(program exited with code :132)

i have searched this exit code on internet but couldn't find a single thread or issue about it

like image 848
ibnetariq Avatar asked Jun 08 '14 08:06

ibnetariq


1 Answers

132 = 128 + 4

man exit:

>128   A command was interrupted by a signal.

man -s 7 signal

SIGILL        4       Core    Illegal Instruction

Later

The -I/usr/local/include -I/usrlocal/include/opencv makes sense for the compile-only (-c) call (but not for the second g++ call which links the executable). But libraries aren't specified by their full paths. What you normally do, is to specify one -L/usr/local/lib (or similar) for each directory, and -lopencv_calib3d (or similar) for each library in those directories (omitting lib and .so.)

like image 98
laune Avatar answered Nov 03 '22 20:11

laune