Ask Your Question
0

problem with Eclipse Indigo/MinGW/run

asked 2013-05-11 09:35:53 -0600

AngeloV gravatar image

updated 2013-05-11 09:41:33 -0600

image description

My Eclipse collapses when i execute the code...

I'm using this example but in Windows Vista: http://docs.opencv.org/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html

In GCC C++ Compiler i putted "C:\opencv\build\include" In GCC C Compiler "C:\opencv\build\include" In MinGw C++ Linker "C:\opencv\build\x86\mingw\lib" and i load all dynamic lib

when i build all, it is all ok... when i click on run, Eclipse collapse and there is a message of window that program will be stop

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-05-11 10:53:52 -0600

berak gravatar image

updated 2013-05-11 10:54:53 -0600

your program seems to want the image-name as an argument to the cmdline.

(no idea, how to supply that in eclipse, i'm not using it. but did you try running your prog from the console, and actually supply an image name [like "myprog.exe lena.jpg"] ? )

but to make your prog more safe against the absence of args:

int main( int argc, char **argv ) 
{
    if ( argc<2 ) // check, if there's args at all 
    {             // i think, your prog crashes, because you're using argv[1], and there's no such thing
        printf("please supply an image name\n"); 
        return -1; 
    }
    Mat image = imread(argv[1]);
    if ( image.empty() )
    {
        printf("image '%s' not found or invalid\n", argv[1]); 
        return -1; 
    }

    ...
edit flag offensive delete link more

Comments

Eclipse collaps again.....by cmd, instead, there is a message: libstdc++-6.dll not found

AngeloV gravatar imageAngeloV ( 2013-05-11 11:23:28 -0600 )edit

Question Tools

Stats

Asked: 2013-05-11 09:35:53 -0600

Seen: 321 times

Last updated: May 11 '13