# Problem understanding OpenCV\_DIR system variable

**URL:** <https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032>\
**Category:** Uncategorized\
**Tags:** windows, build, cmake\
**Created:** [May 2, 2023, 2:07pm UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032 "2023-05-02T14:07:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/dnn/32/7807_2.png) [@dnn](https://forum.opencv.org/u/dnn)\
**Post date:** [May 2, 2023, 2:07pm UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032/1 "2023-05-02T14:07:13Z")

</div>

Hello,

I have troubles understanding the meaning of the OpenCV\_DIR system variable. I am following this tutorial [OpenCV: Installation in Windows](https://docs.opencv.org/4.x/d3/d52/tutorial_windows_install.html) but it is not clear to me if this variable has to be set with my current OpenCV library build or if it will hold the location of the binaries where I will build my project? Could someone clarify?

The particular steps where this is mentioned are entitled " Set the OpenCV environment variable and add it to the systems path" it is on bottom of the tuttorial page.

In case it has to be set with a folder from my OpenCV library, why I don’t see such a folder?

Please help!

---

<div class="post-metadata">

**Author:** ![dnn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/dnn/32/7807_2.png) [@dnn](https://forum.opencv.org/u/dnn)\
**Post date:** [May 2, 2023, 2:14pm UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032/2 "2023-05-02T14:14:10Z")

</div>

I think I got it it should be “C:\opencv-4.x\Build-4.x\install\x64\vc17” so it is where the binaries are.

---

<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:** [May 2, 2023, 3:11pm UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032/3 "2023-05-02T15:11:36Z")

</div>

No OPENCV\_DIR is path whereyou installed opencv  
OPENCV\_DIR=c:\install\opencv

and C:\install\opencv\x64\vc17\bin should be in PATH variable

---

<div class="post-metadata">

**Author:** ![dnn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/dnn/32/7807_2.png) [@dnn](https://forum.opencv.org/u/dnn)\
**Post date:** [May 3, 2023, 10:22am UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032/4 "2023-05-03T10:22:06Z")

</div>

Thank you, but I think I have set it correctly given the instructions on the tutorial and folder structure on my machine.

---

<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:** [May 3, 2023, 1:26pm UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032/5 "2023-05-03T13:26:10Z")

</div>

You are too funny.  
You are right but you ask another question because PATH variable is not set  
OPENCV\_DIR is used by cmake not windows .  
[Note  
On Windows plugins must be linked with existing OpenCV build. Set OpenCV\_DIR environment or CMake variable to the directory with OpenCVConfig.cmake file, it can be OpenCV build directory or some path in the location where you performed installation.](https://docs.opencv.org/4.x/d0/d3d/tutorial_general_install.html)

If you don’t use cmake you cannot see this message:  
`-- You might need to add C:\tmp\install\opencv\x64\vc17\bin to your PATH to be able to run your applications.`

---

<div class="post-metadata">

**Author:** ![dnn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/dnn/32/7807_2.png) [@dnn](https://forum.opencv.org/u/dnn)\
**Post date:** [May 3, 2023, 1:31pm UTC](https://forum.opencv.org/t/problem-understanding-opencv-dir-system-variable/13032/6 "2023-05-03T13:31:33Z")

</div>

Yes, about the C:/install/\*\*\*/bin path I also think that it should be added to the system Path variable. I got a problem running dlls.
