# OpenCV\_DIR created and bin folder with all dlls added do PATH for Windows

**URL:** https://discourse.cmake.org/t/opencv-dir-created-and-bin-folder-with-all-dlls-added-do-path-for-windows/11640
**Category:** Code
**Tags:** os:windows
**Created:** [September 11, 2024, 12:33am UTC](https://discourse.cmake.org/t/opencv-dir-created-and-bin-folder-with-all-dlls-added-do-path-for-windows/11640 "2024-09-11T00:33:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sea\_Sea](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sea_sea/32/4025_2.png) [@Sea\_Sea](https://discourse.cmake.org/u/Sea_Sea)
#### Post date: [September 11, 2024, 12:33am UTC](https://discourse.cmake.org/t/opencv-dir-created-and-bin-folder-with-all-dlls-added-do-path-for-windows/11640/1 "2024-09-11T00:33:24Z")

</div>

- under Windows all environment variables must be set correctly (i.e. OpenCV\_DIR created and bin folder with all dlls added do PATH).

[https://docs.opencv.org/4.x/db/df5/tutorial\_linux\_gcc\_cmake.html](https://docs.opencv.org/4.x/db/df5/tutorial_linux_gcc_cmake.html)

I follow the step to build opencv on `windows` and then I run the \*.exe  
that build. It show not found opencv\_world4100d.dll

Why does opencv need to set bin folder with all dlls added do PATH ?  
But other library doesnt need to set bin folder with all dlls added do PATH

---

<div class="post-metadata">

### Author: ![retif](https://discourse.cmake.org/user_avatar/discourse.cmake.org/retif/32/1776_2.png) [@retif](https://discourse.cmake.org/u/retif)
#### Post date: [September 11, 2024, 7:44am UTC](https://discourse.cmake.org/t/opencv-dir-created-and-bin-folder-with-all-dlls-added-do-path-for-windows/11640/2 "2024-09-11T07:44:52Z")

</div>

> other library doesnt need to set bin folder with all dlls added do PATH

If an executable has runtime dependencies, such as DLLs on Windows, all of those dependencies binaries should indeed be available in `PATH`.

So while other libraries might not tell you to do that, it is assumed to be a common knowledge, which is I guess why you don’t see this too often being mentioned in other libraries documentations.

But usually instead of adding them to `PATH` they are deployed together with that executable - that way it will be able to discover them without `PATH` manipulations. Modifying `PATH` to make DLLs discoverable isn’t a great idea in general.

> and bin folder with all dlls added do PATH

…so that doesn’t sound like a good recommendation, and ~~I doubt that official OpenCV documentation does in fact state that~~ ha, they actually [do state](https://docs.opencv.org/4.x/d3/d52/tutorial_windows_install.html#tutorial_windows_install_path) that.
