Ask Your Question

Open CV with Visual Studio 2017

asked 2018-02-02 08:11:09 -0500

Werz gravatar image


I want to use Open CV 3.4.0 with Visual Studio 2017, is this possible? Operating System is Windows 7 64 Bit. When installing Open CV 3.4.0 I want to use the prebuilt libraries, but there are only the Folders VC14 and VC15 in the Directory opencv/build/x64/

Which libraries should I use in this case, Folder VC14 or 15? Is it even possible with VS2017?

Thank you!

edit retag flag offensive close merge delete


use vc15 but you should build yourself opencv using cmake and vs2017

LBerger gravatar imageLBerger ( 2018-02-02 08:13:02 -0500 )edit

If I go through the tutorial: you mean, that I should not use the brebuild libraries, inhstead I should make my own libraries from the source files? Is this right?

Werz gravatar imageWerz ( 2018-02-02 08:18:06 -0500 )edit

I think it's a good idea to learn cmake (and git-bash) Install cmake and git bash. You can follow this tutorials and opencv will be installed with opencv_contrib in debug and release mode

CMAKE_CONFIG_GENERATOR="Visual Studio 15 2017 Win64"

LBerger gravatar imageLBerger ( 2018-02-02 08:22:09 -0500 )edit

ok thank you, so I will execute the tutorial chapters "Installation by Using the Pre-built Libraries" and the following chapter "Installation by Using git-bash (version>=2.14.1) and cmake (version >=3.9.1)". The next step "Installation by Making Your Own Libraries from the Source Files" is not necessary in this case, is this right?

Thank you!

Werz gravatar imageWerz ( 2018-02-02 08:36:53 -0500 )edit

sorry, now I think I understand, I just Need to follow your link, the first stepo is not necessary... OK, I will try!

Werz gravatar imageWerz ( 2018-02-02 08:40:14 -0500 )edit

Okay, this is running now, but additional question: is this now done fpor using dynamic libraries or static ones? Or I am still able to use both?

Werz gravatar imageWerz ( 2018-02-02 09:09:16 -0500 )edit

Now, after executing this step, the Foöder Build/openCV is empty. I guess that I have to execute also the chapter "Installation by Making Your Own Libraries from the Source Files" from the tutorial now, to build the library, is this correct?

Werz gravatar imageWerz ( 2018-02-02 09:22:32 -0500 )edit

No it should't be empty. after executing this step? which one


LBerger gravatar imageLBerger ( 2018-02-02 10:10:29 -0500 )edit

Why don't you just try it? I have successfully used the pre-built libraries with VS 2017 Community Edition. Make sure that you build your app targeting x64 architecture.

sjhalayka gravatar imagesjhalayka ( 2018-02-02 10:28:36 -0500 )edit

@sjhalayka "should build yourself opencv using cmake and vs2017" some people do not like shorter way. Now if you take longer way you can use cuda lapack eigen caffe....that's not in prebuild

LBerger gravatar imageLBerger ( 2018-02-02 10:35:41 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2018-02-05 01:53:16 -0500

Werz gravatar image

I have executed the step "Installation by Using git-bash (version>=2.14.1) and cmake (version >=3.9.1)" like in your tutorial link above, and stopped before "Installation by Making Your Own Libraries from the Source Files", this step was not executed.

The process was successfully done, now I have under C:/lib the following Contents:

  • Folder Build
  • Folder Install
  • Folder opencv
  • Folder opencv_contrib
  • script file that i have used during Installation

In the Folder Build there is a subfolder "opencv" that is empty, same for Folder Install

Folder opencv and opencv_copntrib have some Contents, among others also "include" Folder...

@LBerger: You described, that the Folder Build shouldn't be empty.

edit flag offensive delete link more


I can finde the sources, Header and cpp files, of the modules, but no vc14 or vc15 Folder with binaries, that I can execute the next steps of the tutorial, how can I go on here?

Thank you!

Werz gravatar imageWerz ( 2018-02-05 02:04:47 -0500 )edit

As there is no success, I have tried from the beginning again to install by using the prebuilt libraries. No I have the Problem, that when starting Debugger with the sample code descrtibed here: chapter "Test it!"

I get the error message: "The program can't start because opencv_world340.dll is missing from your Computer. Try reinstalling the program to fix this Problem."

I'm now very confused because non of the descriptions of the tutorial is working on my Computer.

Therefore, can please somebody tell me: There are 4 chapters in the tutorial, for Installation in Windows:

Which of them do I have to execute (AND/OR) Thank you very much!

Werz gravatar imageWerz ( 2018-02-05 10:01:36 -0500 )edit

I started again to use the prebuilt libraries, but now I used the vc14 Folder as the link for the Compiler and linker, now it works. Don't know, why I wasn't successfull with the vc15 Folder...

Werz gravatar imageWerz ( 2018-02-06 02:10:09 -0500 )edit

I don't know if you still need help. "opencv_world340.dll" you can copy opencv_world340.dll where is your exe file or add to system variable path folder where is opencv_world340.dll . If you change toolset in vs 2017 you can use vc14 folder but it means you use vc 2015 compiler (embedded in vs2017)

LBerger gravatar imageLBerger ( 2018-02-06 14:26:59 -0500 )edit

Hello, thank you for answering, but now it works. I have used the vc14 Folder, with vc15 Folder it didn't work, I don't know why. Now it works and I am trying do do the whole tutorial....

Thank you!

Werz gravatar imageWerz ( 2018-02-07 01:49:59 -0500 )edit

Maybe someone can tell me the difference between this 2 Folders vc14 and vc15: is there any functionality more in vc15 that I can't use in vc14?

Werz gravatar imageWerz ( 2018-02-07 02:14:25 -0500 )edit

Question Tools

1 follower


Asked: 2018-02-02 08:11:09 -0500

Seen: 8,499 times

Last updated: Feb 05 '18