opencv 3.1.0 winx64 c++ app fails only from within VS 2013 and 2015 IDEs (works on cmd line)

asked 2016-03-17 12:00:28 -0500

psoriasis gravatar image

This is an addendum from yesterday's post before I tried VS 2015 and found the same issue. A console app compiled using VS2013 or VS2015 using opencv 3.1.0 works fine form the command line but fails with memory errors under Visual C++. The program as originally developed under opencv 2.4.10 and had not problem under VS 2013

=== This is true for both release and debug builds. i built it, a x64 console app, under Visual Studio 2013. Using process explorer, I can see that I have the exact same command line (i.e. exact same app and args) and working directory for the exe launched via VS and manually from the command line. I can see it's using the same expected libraries (e.g. opencv_world310d for debug).

The opencv 3.1.0 was directly from the download (I didn't build it)

I'm running under Win10 x64.

Though it runs fine directly for the command line, in VS it blows up in the repeat function: First-chance exception at 0x00007FFFB5CF1F08 in HSV.exe: Microsoft C++ exception: cv::Exception at memory location 0x0000008AC80FB010.

That is not the the first opencv routine the program ran so...I'm baffled.

I copyied the repeat source code (out of copy.cpp) and made a repeata function out of it that I compiled and called with my app and that worked but then it blew up later on another opencv call.

If I hadn't had this running constantly for months under opencv 2.4.10 (Under VS2012)* or if it didn't run fine under both debug and release modes (using 3.1.0) outside VS 2013, I'd just chalk it up to a memory error elsewhere that just happen to finally make itself know but given this context I'm thinking it has something to do with the VS2013 environment but I don't know what to do about it.

I took my errant VS2013 project and just changed it so that it linked (and loaded) the 2.4.10 (debug) libs/dlls and can run without any problems So, it seems that just the fact that the project is linking and load 3.1.0 vs 2.4.10 libs/dlls is enough to make it crash but only in the VS2013 IDE(but the same executable and context run just fine from the command line)

edit retag flag offensive close merge delete