简体   繁体   中英

cv:Exception at memory location - Running openCV code Visual studio 2013 & Visual studio 2017 - Windows 7

How can I get rid of Exceptions in Visual Studio? Possibly from project exception settings?

I am using openCV 2.4.9 library with c++ code library in Visual studio. when I run the code. I tried library with 2012 & 2015 also but had "lnk1104" error for missing library file . I tried resolving those with solutions found from internet ( redistributable c++ package & others) but couldn't fix it.

So I tried in 2013 & 2017, but get the unhandled exceptions(Microsoft C++ exception: cv::Exception at memory location 0x0037AD58(& other locations too)) for both versions.

I have been trying to run code successfully since last 3 days.

Can anyone please help me? Thanks in advance.

exceptions are baked into the code, so you can't rid of them. The best you can do is to use try catch

try
{
    my_exception_throwing_function();
}
catch(err)
{

}

But in your case I think it's a linker problem. You need to tell the compiler where all the binaries of OpenCV. Check the linker page of the compiler.

Did you recompile OpenCV yourself? Did you use precompiled binaries? if so, were the binaries compiled with the same compiler you are using? Which version of OpenCV are you using?

I would go to the documentations of OpenCV, they have good guides to setup the toolchain. https://docs.opencv.org/2.4/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM