Visual Studio中的C ++和OpenCV退出并出现代码-1(0xffffffff)错误 [英] C++ and OpenCV in Visual Studio exited with code -1 (0xffffffff) error

查看:625
本文介绍了Visual Studio中的C ++和OpenCV退出并出现代码-1(0xffffffff)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码构建良好,但是当我调试时,我得到的是:

My code builds fine but when I debug this is what I get:

'Proj_OpenCV.exe': Loaded 'C:\Users\Saher\Documents\Visual Studio 2008\Projects\Proj_OpenCV\Debug\Proj_OpenCV.exe', Symbols loaded.
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'Proj_OpenCV.exe': Loaded 'C:\Users\Saher\Downloads\OpenCV2.3\build\x86\vc9\bin\opencv_core230.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll'
'Proj_OpenCV.exe': Loaded 'C:\Users\Saher\Downloads\OpenCV2.3\build\x86\vc9\bin\opencv_highgui230.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\user32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\avicap32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\version.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll', Symbols loaded.
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll', Symbols loaded.
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll'
'Proj_OpenCV.exe': Loaded 'C:\Program Files (x86)\McAfee\SiteAdvisor\sahook.dll'
The program '[5748] Proj_OpenCV.exe: Native' has exited with code -1 (0xffffffff).

我的代码如下,来自 OpenCV教程页面

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std; 

int main( int argc, char** argv )
{ 



    if( argc != 2) 
    {
     cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
     return -1;
    }

    Mat image;
    image = imread(argv[1], CV_LOAD_IMAGE_COLOR);   // Read the file

    if(! image.data )                              // Check for invalid input
    {
        cout <<  "Could not open or find the image" << std::endl ;
        return -1;
    }

    namedWindow( "Display window", CV_WINDOW_AUTOSIZE );// Create a window for display.
    imshow( "Display window", image );                   // Show our image inside it.

    waitKey(0);                                          // Wait for a keystroke in the window


    return 0;
}

任何与该错误有关的帮助以及如何解决此错误,将不胜感激.

Any help with this error and how to resolve it will be appreciated.

推荐答案

  • 应从cmd行执行该应用程序
  • 启动此应用程序时,需要在cmd行中将图像名称作为参数传递:display_image.exe test.jpg
    • The application should be executed from the cmd line
    • You need to pass the name of the image as a parameter in the cmd line when you launch this application: display_image.exe test.jpg
    • 或者,如果要从Visual Studio中执行它,请确保将图像文件名设置为:

      Or, if you are executing it from Visual Studio, make sure you set the image filename at:

      Project Properties > Configuration Properties > Debugging > Command Arguments
      

      这篇关于Visual Studio中的C ++和OpenCV退出并出现代码-1(0xffffffff)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆