OpenCV with project CLR

asked 2018-09-03 06:41:53 -0600

Oulina gravatar image

updated 2018-09-03 06:59:15 -0600

I created project CLR (Visual Studio 2017) with all forms and elements. On the Internet, I found the settings for the OpenCV installation, but as a result, when connecting the library #include <opencv cv.h=""> a different list of errors is issued. I added path to the system settings and connected all the directories / libraries in the settings of a particular project. I tried different versions of OpenCV (3.4.3,, 3.4.2). Then added library at the c++ project. But the result was similar. I tried change x86 to x64, but no result. I apply all the screenshots of the code, settings and errors. Here on this video the developer explicitly uses the clr project, how did he do it?</opencv>

I will be grateful for the help! It is very necessary to deal with the problem. Thx!

edit retag flag offensive close merge delete


i removed your screenshots, they are all useless here.

(they can't be indexed, ppl cannot quote you, you're stealing other folks bandwith, etc.)

please edit your question again, and add a text version, describing your problem instead, thank you.

berak gravatar imageberak ( 2018-09-03 06:46:38 -0600 )edit

and if you want my 2ct: both using opencv's deprecated c-api and clr/cli is a terrible idea. (opencv uses a c++ RAII model, while clr is gc-based, those things do not fit together at all.)


berak gravatar imageberak ( 2018-09-03 06:51:12 -0600 )edit

ok, I did it

Oulina gravatar imageOulina ( 2018-09-03 06:53:05 -0600 )edit

But here on this video the developer explicitly uses the clr project, how did he do it?

Oulina gravatar imageOulina ( 2018-09-03 06:58:24 -0600 )edit

btw, you don't need the opencv_ts lib, this is only for unit tests.

but that will still leave you with the mutex / c++11 problems

berak gravatar imageberak ( 2018-09-03 07:05:56 -0600 )edit

can there be a problem in the VS version? on the video example in the 2015 version

Oulina gravatar imageOulina ( 2018-09-03 07:11:33 -0600 )edit

i've no idea, what it is exactly, but you'll for sure run into trouble using a modern opencv / VS version.

imho the only "proper" way to do this is: seperate your opencv code from the CLR one. put it into seperate translation units / files, maybe even into a dll. see, that your interfaces to this do NOT use anything from opencv

berak gravatar imageberak ( 2018-09-03 07:21:09 -0600 )edit Here is another example of using opencv in cli, but the code does not show.

I also found such an example solution using clr, but because of the VS versions it does not work. I will install 2015

Oulina gravatar imageOulina ( 2018-09-03 07:32:13 -0600 )edit

" but the code does not show. " -- yea youtube videos are a waste of time (imho)

and the blogpost is from 2013, using vs2010 and the DEAD c-api -- bad idea, too.

berak gravatar imageberak ( 2018-09-03 07:46:26 -0600 )edit

May be you use cmake with CLR now

LBerger gravatar imageLBerger ( 2018-09-03 07:53:02 -0600 )edit