1. 程式人生 > >OpenCV 和 VS 2015 C++ 再release的除錯模式下出現 exception 0xC0000005

OpenCV 和 VS 2015 C++ 再release的除錯模式下出現 exception 0xC0000005

thanks that helped, by mistake I set the same lib under the Linker settings for Debug and Release settings. After I changed opencv_world310.lib into opencv_world310d.lib (Linker-->Input-->Additional dependencies)

意思是即使在release模式下,只要除錯(debug),聯結器都要配置除錯 版本的opencv,親測有效。

PS:這個問題只在VS 2015上面出現,在VS2013和VS2017則沒有這個問題,可以配置相應的Release和Debug版本。

本人測試了3.3.0、3.1.0、3.4.1三個版本對VS 2015的支援,發現3.3.0和3.4.1有上述的問題,而3.1.0則兩個配置Debug和Release版本都沒用,故推測opencv對VS2015的release x64支援上存在問題。

在VS 2015 的Release x64條件下:OpenCV3.1.0可以配置opencv_world310.lib,而OpenCV3.3.0和OpenCV3.4.1則需要換成opecv_world330d.lib和opecv_world341d.lib才能執行。(PS: 每次更換都重新生成了解決方案)