# OpenCV installation on Windows, missing vc15 folder

**URL:** <https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031>\
**Category:** Uncategorized\
**Tags:** windows, build, cmake\
**Created:** [March 8, 2021, 9:52am UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031 "2021-03-08T09:52:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 9:52am UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/1 "2021-03-08T09:52:11Z")

</div>

Hi everyone,  
I’m trying to install OpenCV on my windows 10 machine for academic purpose. I have to follow an installation guide provided by my professor, that requires VisualStudio 2017 and Cmake. I have done literally any point of that guide, that I report -brielfy- here:

1. Install VisualStudio 2017 and Cmake
2. Download (from github) opencv-3.3.1 and opencv\_contrib-3.3.1 and unzip them into a folder ‘source’ (created before together with another folder ‘build’ inside another folder ‘C:\workspace’)
3. Use Cmake (Source code: …opencv3\source\opencv, where to build: opencv3\build). Generator: VisualStudio 15 2017 Win64.
4. When Cmake finishes, look for “OPENCV\_EXTRA\_MODULES\_PATH” and set it to your opencv\_contrib/modules path.  
Press Configure and then Generate
5. Open the OpenCV.sln file with VisualStudio, change to Release the build type, then find the INSTALL project inside CMakeTargets folder and build it.

Now, I need to add to the environment variables a new variable OPENCV\_DIR with value …\opencv3\build\install\x64\vc15

Now…the problem is that, inside the install folder, **there’s NO x64 DIRECTORY, and I cannot find ANY vc15 DIRECTORY in the entire build folder** … I really don’t know how to proceed, since I’ve been looking for a solution for at least 3 hours… Is there anyone that would kindly help me?

Thanks in advance (and sorry if I did s.thing wrong in creating the topic)

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 10:42am UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/2 "2021-03-08T10:42:47Z")

</div>

What is inside the install directory? Did the build complete without any errors and are you sure you built the INSTALL target?

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 11:05am UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/3 "2021-03-08T11:05:15Z")

</div>

Directory di C:\workspace\opencv3\build\install

08/03/2021 09:55 \<DIR\> .  
08/03/2021 09:55 \<DIR\> …  
08/03/2021 09:55 \<DIR\> bin  
08/03/2021 09:55 \<DIR\> etc  
08/03/2021 09:55 \<DIR\> include  
08/03/2021 09:55 \<DIR\> lib  
07/03/2021 22:30 2.234 LICENSE  
08/03/2021 09:38 433 OpenCVConfig-version.cmake  
08/03/2021 09:38 5.605 OpenCVConfig.cmake  
3 File 8.272 byte  
6 Directory 177.669.537.792 byte disponibili

This is the content of the directory, and…yes, the build completed without any error or warning, and I’m 100% sure I built the INSTALL target under CMakeTargets folder

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 11:46am UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/4 "2021-03-08T11:46:55Z")

</div>

It looks like the locations for OpenCV 3 are different to 4. Because I am not sure how your OPENCV\_DIR variable will be used, I cannot tell you conclusively which directory to set it to. In OpenCV 4 the

> [@E\_Past](#):
>
> …\opencv3\build\install\x64\vc15

directory contains the lib and bin folder. If the OPENCV\_DIR is just used for that then you can set it to

> …\opencv3\build\install\

However I suspect that OPENCV\_DIR could also used to locate the include directory so you may find some of your projects have something similar to

`..\..\include`

in the project properties, C/C+±\>General-\>Additional Include Directories. In that case you would need to remove the proceeding …..\ and just leave  
`include`

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 12:45pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/5 "2021-03-08T12:45:46Z")

</div>

> [@cudawarped](#):
>
> Because I am not sure how your OPENCV\_DIR variable will be used, I cannot tell you conclusively which directory to set it to.

Maybe this (the following of the guide I’m following) may help:

"[after creating OPENCV\_DIR] access the Path variable and add the lines:

```
%OPENCV_DIR%\bin
%OPENCV_DIR%\lib

```

and confirm."

Does this change anything? I would like to be sure before doing anything

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 12:48pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/6 "2021-03-08T12:48:04Z")

</div>

Yes in which case you should be able to use

> …\opencv3\build\install\

Not sure why you are adding %OPENCV\_DIR%\lib as well as %OPENCV\_DIR%\bin maybe cmake etc. picks up the lib paths in your project. Either way the above should work.

---

<div class="post-metadata">

**Author:** ![laurent.berger](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@laurent.berger](https://forum.opencv.org/u/laurent.berger)\
**Post date:** [March 8, 2021, 1:06pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/7 "2021-03-08T13:06:50Z")

</div>

Can you post cmakecache.txt?

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 1:17pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/8 "2021-03-08T13:17:37Z")

</div>

> **[CMakeCache.txt](https://wetransfer.com/downloads/40d6cb60d0300ded11ef62a1d6384e2020210308131653/c78cb5)**
>
> 1 file sent via WeTransfer, the simplest way to send your files around the world

Here it is @laurent.berger

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 1:45pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/9 "2021-03-08T13:45:44Z")

</div>

However, I set …\opencv3\build\install\ as value for OPENCV\_DIR, and still nothing works. I’m compiling a sample project provided by my professor, saved as .cpp, that has only the directive:

```
#include <opencv2\highgui.hpp>

```

by using cmd:

```
g++ -o [file] lopencv_highgui -lopencv_core

```

and the result is always “no such file or directory bla bla bla”… but inside \build\install\include\opencv2 I can find the library highgui.hpp, indeed.  
I tried also to modify the OPENCV\_DIR variable according to the path were the .hpp file is, but nothing changes

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 1:51pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/10 "2021-03-08T13:51:14Z")

</div>

It looks like the OPENCV\_DIR variable is being used to detect the headers as well as I suspected in my previous post. Therefore you will need to find where it is referenced, probably something like

`%OPENCV_DIR%\..\..\include`

and change it to

`%OPENCV_DIR%\..\..\include`

Just out of interest are you building your project on linux or using g++ on windows?

If you want you can just change

```auto
#include <opencv2\highgui.hpp>

```

to the actual path where highgui.hpp is to check that this is your only issue.

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 3:08pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/11 "2021-03-08T15:08:59Z")

</div>

`C:\workspace\opencv3\build\install\include\opencv2`  
This is the path where all the headers are located. I tried to modify OPENCV\_DIR with this, and I changed  
`%OPENCV_DIR%\bin %OPENCV_DIR%\lib`  
to just  
`%OPENCV_DIR%`  
but still nothing.

So I tried also to define OPENCV\_DIR as:  
`C:\workspace\opencv3\build\install`  
and then add to path variable  
`%OPENCV_DIR%\include\opencv2`  
but this was useless.

And also changing the directive with:  
`#include <highgui.hpp>`

HOWEVER…  
I wrote `#include <C:\workspace\opencv3\build\install\include\opencv2\highgui.hpp>` and this seems to correctly include highgui.hpp, but then the compiler tells me:  
`C:\workspace\opencv3\build\install\include\opencv2\highgui.hpp:46:28: fatal error: opencv2/core.hpp: No such file or directory #include "opencv2/core.hpp"`

This means that highgui was found, but now it doesn’t find core.hpp (that is included INSIDE highgui, as I see)

I’m on windows

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 3:21pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/12 "2021-03-08T15:21:09Z")

</div>

Is the project you are building fixed or do you use cmake to generate it?

If its fixed, somewhere in your configuration the path to  
`C:\workspace\opencv3\build\install\include\`  
will be specified, probably as  
`%OPENCV_DIR%\..\..\include`  
If you are unable to find it I would suggest manually adding  
`C:\workspace\opencv3\build\install\bin\`  
and  
`C:\workspace\opencv3\build\install\lib\`  
to your user path. That way the executable can find the opencv dll’s when you run it and if you have another project that autodetects the libs using a cmake or other script they will be on the path.  
Then set OPENCV\_DIR to  
`C:\workspace\opencv3\build\install\x64\vc15`  
I know it doesn’t exist but the headers should be found.  
Then you will probably find that your lib’s won’t be detected as they are probably also relative to OPENCV\_DIR.

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 3:22pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/13 "2021-03-08T15:22:37Z")

</div>

just for the sake of completeness:  
`C:\workspace\opencv3\build\install` includes 4 directories:  
`bin`, with .exe and .dll files  
`lib`, with .lib and some .cmake files  
`etc`, only .xml  
`include`, with `opencv2` folder inside, which has .hpp files and some other folders (among these also a directory ‘highgui’ with a different highgui.hpp and a highui\_c.h).

Now I wonder if I’m looking at the wrong directory

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 3:24pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/14 "2021-03-08T15:24:07Z")

</div>

I don’t know what you mean by fixed, I used Cmake ONLY to compile the openCV library.  
Give me just some minutes and I try with your last reply…

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 3:34pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/15 "2021-03-08T15:34:37Z")

</div>

![Immagine](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/e/ec4ee243886511a57118ed92c16ccc442040c446.png)

Still nothing. This is my last try for the path variable, I thought at least one could work fine… obviously OPENCV\_DIR is set to …\install

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 3:39pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/16 "2021-03-08T15:39:53Z")

</div>

Forget everything, just add the include directory to your compile options

```auto
g++ -o [file] lopencv_highgui -lopencv_core -IC:/workspace/opencv3/build/install/include/

```

and set OPENCV\_DIR to `C:/workspace/opencv3/build/install`.

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 4:46pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/17 "2021-03-08T16:46:13Z")

</div>

```
C:\Users\epast\Desktop>g++ -o OpenImg OpenImg.cpp -lopencv_highgui -lopencv_core -IC:\workspace\opencv3\build\install\include
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lopencv_highgui
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lopencv_core
collect2.exe: error: ld returned 1 exit status

```

I would say better, but still not solved

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 5:34pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/18 "2021-03-08T17:34:38Z")

</div>

I would check that you can find

`opencv_highgui.lib`

from cmd with

`where opencv_highgui.lib`

Incidentally isn’t it something like opencv\_highgui331.lib

If it can’t be found I would verify that the OPENCV\_DIR\lib is on the system/user path as I am assuming this is how g++ picks up libs on windows.

Additionally I would ask your professor to correct the instructions as they are for OpenCV 4.

---

<div class="post-metadata">

**Author:** ![E\_Past](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/e_past/32/1312_2.png) [@E\_Past](https://forum.opencv.org/u/E_Past)\
**Post date:** [March 8, 2021, 6:49pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/19 "2021-03-08T18:49:48Z")

</div>

I can’t find  
`opencv_highgui.lib`  
But I succesfully find  
`opencv_highgui331.lib`

However I give up, I spent 8 hours on it today.

@cudawarped thanks for your time, anyway

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 8, 2021, 8:29pm UTC](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031/20 "2021-03-08T20:29:35Z")

</div>

Try

```auto
g++ -o [file] lopencv_highgui331 -lopencv_core331 -IC:/workspace/opencv3/build/install/include/

```

[Next page](https://forum.opencv.org/t/opencv-installation-on-windows-missing-vc15-folder/2031.md?page=2)
