First chance exception & R6025-pure virtual function call的問題 Opencv

來源:互聯網
上載者:User

今晚寫程式沒多久,程式也沒任何報錯和warning,但運行後映像窗戶馬上消失,無法顯示,調程式浪費了一個多小時,遇到千奇百怪的問題,徹底抓狂,最後在程式沒修改的情況下換上我筆記本運行,經完全沒錯!

調試的時候報的問題一個是First chance exception,有時還會莫名出現R6025-pure virtual function call,不穩定~

對於第二個問題,即R6025,一般認為是視窗沒銷毀造成的,但我用的是C++版本,不用手工銷毀視窗,他居然報錯~不理解

對於第一個問題,查了些資料,有認為是kernel32.dll的問題,下面摘下了比較專業的解釋,對於這兩個問題我最終的解決方案是:重啟!然後完全沒錯!如果你遇到第二個錯誤而且用的是cvNamedWindow,就要檢查下是不是沒有Destroy。

----------------------------------------------------------------------------

Have you ever been debugging an application and seen a message, in the output window, about a "First chance" exception?


Ever wondered:

  • What is a first chance exception?
  • Does a first chance exception mean there is a problem in my code?

What is a first chance exception?
When an application is being debugged, the debugger gets notified whenever an exception is encountered  At this point, the application is suspended and the debugger decides how to handle the exception. The first pass through this mechanism is called
a "first chance" exception. Depending on the debugger's configuration, it will either resume the application and pass the exception on or it will leave the application suspended and enter debug mode. If the application handles the exception, it continues to
run normally.

In Visual Studio, you may see a message in the output window that looks like this:

A first chance exception of type 'System.ApplicationException' occurred in myapp.exe

In Visual Studio 2005 Beta2, you will see this message anytime a first chance exception is encountered in your application's code.  If you are using Visual Studio .NET 2003, this message is shown if you have configured the debugger to stop when the specific
exception type is thrown.

If the application does not handle the exception, the debugger is re-notified. This is known as a "second chance" exception. The debugger again suspends the application and determines how to handle this exception. Typically, debuggers are configured to stop
on second chance (unhandled) exceptions and debug mode is entered, allowing you to debug. 

Does a first chance exception mean there is a problem in my code?
First chance exception messages most often do not mean there is a problem in the code. For applications / components which handle exceptions gracefully, first chance exception messages let the developer know that an exceptional situation was encountered
and was handled.

For code without exception handling, the debugger will receive a second chance exception notification and will stop with a unhandled exception.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.