# Opencv\_world.dll on windows

**URL:** <https://forum.opencv.org/t/opencv-world-dll-on-windows/18913>\
**Category:** C++\
**Tags:** build\
**Created:** [October 8, 2024, 7:40am UTC](https://forum.opencv.org/t/opencv-world-dll-on-windows/18913 "2024-10-08T07:40:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sea\_Sea](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sea_sea/32/11091_2.png) [@Sea\_Sea](https://forum.opencv.org/u/Sea_Sea)\
**Post date:** [October 8, 2024, 7:40am UTC](https://forum.opencv.org/t/opencv-world-dll-on-windows/18913/1 "2024-10-08T07:40:01Z")

</div>

I build opencv with this parameter

```auto
      -DBUILD_SHARED_LIBS=ON `
      -DBUILD_PERF_TESTS=OFF `
      -DBUILD_TESTS=OFF `
      -DBUILD_DOCS=OFF `
      -DWITH_CUDA=OFF `
      -DBUILD_EXAMPLES=OFF `
      -DINSTALL_CREATE_DISTRIB=ON

```

Q1.  
I write a foo library that use opencv. When I use the foo, my program will show can not found opencv\_world.dll.

I dont want to depend on the opencv\_world.dll. How can I do?

Q2.  
main project `bar` will call the `foo`  
where `foo` is a library and it use the opencv.

Does it mean when I use the `foo` libraray, I must be put opencv\_world.dll on my main project (same 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:** [October 8, 2024, 8:07am UTC](https://forum.opencv.org/t/opencv-world-dll-on-windows/18913/2 "2024-10-08T08:07:13Z")

</div>

> [@Sea\_Sea](#):
>
> Q1.  
> I write a foo library that use opencv. When I use the foo, my program will show can not found opencv\_world.dll.
> 
> I dont want to depend on the opencv\_world.dll. How can I do?

Why? If you build a static version of OpenCV it will be the same size as including opencv\_world.dll with your application so there will be no difference apart from the number of files you include. i.e. One large application file or one smaller application file and one opencv\_world.dll.

> [@Sea\_Sea](#):
>
> Q2.  
> main project `bar` will call the `foo`  
> where `foo` is a library and it use the opencv.
> 
> Does it mean when I use the `foo` libraray, I must be put opencv\_world.dll on my main project (same folder)

This was answered in your previous post

> [@Why need to set the path for opencv\_world4100d.dll](https://forum.opencv.org/t/why-need-to-set-the-path-for-opencv-world4100d-dll/18716):
>
> opencv\_world4100d.dll not found I download pre-compiled opencv. And using the opencv in my project on windows It always show “opencv\_world4100d.dll not found” Until I set the variable to windows env by hand. Q1. Why need to set opencv\_world4100d.dll ? Becuase other lib just find\_package(XXX) And then I can directly use. Q2. Does any method (automatically) to set the path for windows? Not the interface operation.

To clarify you can

1. Include in your project directory
2. Add to the the location to your system/user path
3. Build a static version of OpenCV and link against that but you need to clarify why you would want to do that and why option 1 and 2 are not suitable solutions for you?

---

<div class="post-metadata">

**Author:** ![Sea\_Sea](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sea_sea/32/11091_2.png) [@Sea\_Sea](https://forum.opencv.org/u/Sea_Sea)\
**Post date:** [October 8, 2024, 8:49am UTC](https://forum.opencv.org/t/opencv-world-dll-on-windows/18913/3 "2024-10-08T08:49:27Z")

</div>

Do you have the example to package (cmake) the project about opencv

---

<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:** [October 8, 2024, 9:11am UTC](https://forum.opencv.org/t/opencv-world-dll-on-windows/18913/4 "2024-10-08T09:11:59Z")

</div>

No but you should be able to use [CPack](https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html).
