The program '[1628] ConsoleApplication3_Test.exe' has exited with code -1 (0xffffffff).
Hello, While Debugging the code mentioned in this link, the console window opens and closes quickly and gives me the following breakdown or error:
'ConsoleApplication3_TEST.exe' (Win32): Loaded 'C:\Users\Yousif\Documents\Visual Studio 2012\Projects\ConsoleApplication3_TEST\x64\Debug\ConsoleApplication3_TEST.exe'. Symbols loaded.
'ConsoleApplication3_TEST.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'ConsoleApplication3_TEST.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'ConsoleApplication3_TEST.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'ConsoleApplication3_TEST.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Symbols loaded.
The program '[1628] ConsoleApplication3_TEST.exe' has exited with code -1 (0xffffffff).
Or even when debugging any of the sample codes in OpenCV\sources\samples\cpp folder it gives me the same error. Any help will be appreciated.
look for a line like
return -1;
in your code ..(it probably expected some cmdline args, or could not find resources, like images)
this is the code I'm testing
when I debug it the console windows flashes, when I run it without debugging (Ctrl+F5) the console window opens with the following message Usage: display_image ImageToLoadAndDisp
But in the "release configuration" when I run the program it gives Could not open or find the image I've put the image in the same folder with the .exe but still nthn worked.
O it wont work by simply trying to guess the right folder where to place the file. Add the file to a known path, for example
C:/test/test.jpg
and than try giving that explicit path as an argument. I am guessing your system doesn't find the file.I gave it an argument, I opened cmd and wrote
C:\Users\Yousif\Documents\Visual Studio 2012\Projects\x64\Release>ConsoleApplication3_TEST.exe image.png
and gave me not recognized as internal or external so i tried another method which is going to visual studio and from debugging configuration I've set command arguments to the specified image but still nthn new. Is there a way that i can specify the path of the image directly from the code without setting an argument? And why the console application flashes when debugging but doesn't flash when i start the program without debugging? And in the release mode it gives me a different statement from the debugging mode? Thanks in advance.waitKey(0); is written at the end of the code, I read this
Warning
If you are using a 64-bit machine, you will have to modify k = cv2.waitKey(0) line as follows : k = cv2.waitKey(0) & 0xFF Is this related to the flashing console window?
^^ no, you're wrong about this . the ' &0xFF' part only applies on some linux, where you get scankey values instead of ascii. (unrelated)
skip the argument phase, probably to harsh for you for now. just change
image = imread(argv[1], CV_LOAD_IMAGE_COLOR);
intoimage = imread("C:\\Users\\Yousif\\Documents\\Visual Studio 2012\\Projects\\x64\\Release\\image.png");
Ohh thanks StevenPuttemans, it worked (Y). It worked for the release configuration, but for debugging still the console window flashes unless I press Ctrl+F5. Anyway I'll skip this tutorial it took a lot of time.