Xcode 3.2.6: compiler returns exception

asked 2013-02-01 13:07:22 -0500

tommi gravatar image

updated 2013-02-02 11:44:09 -0500

Hi all.

I've a problem when i try to compile a simple C code. In particular, compiler generates a BAD ACCESS exception when i try to access image data.

My code is:

#include <stdio.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>

int main(int argc, char *argv)
{
    IplImage *image_in = 0;

    int w,ws,h;

    image_in = cvLoadImage("./clown.bmp",0);

    w = image_in->width;

}

and compiler returns:

Program received signal: “EXC_BAD_ACCESS”.

for the instruction

w = image_in->width;

I'm new in opencv world, and code seems correct, so I don't know what this exception means. Please help me!

Tommi

N.B.: I'm using OpenCV 2.4.3

P.s.: sorry for my not excellent english...

edit retag flag offensive close merge delete