# Problem with .dll when trying to run simple demo example

**URL:** <https://forum.opencv.org/t/problem-with-dll-when-trying-to-run-simple-demo-example/13045>\
**Category:** Uncategorized\
**Created:** [May 3, 2023, 10:58am UTC](https://forum.opencv.org/t/problem-with-dll-when-trying-to-run-simple-demo-example/13045 "2023-05-03T10:58:53Z")\
**Posts on this page:** 4\
**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 3, 2023, 10:58am UTC](https://forum.opencv.org/t/problem-with-dll-when-trying-to-run-simple-demo-example/13045/1 "2023-05-03T10:58:53Z")

</div>

Hello,

I have troubles running the simple example on this page:

[https://docs.opencv.org/4.x/dd/d6e/tutorial\_windows\_visual\_studio\_opencv.html](https://docs.opencv.org/4.x/dd/d6e/tutorial_windows_visual_studio_opencv.html)

The project is build successfully but when I hit the run button in both Debug and Release configurations I get this message “A dependent dll was not found” and the screen  
says that the .dll in question is OpenCV\_core470d.dll (or …core470.dll for release configuration correspondently). I guess this will happen for no matter which dll.

Any help on this?

Thanks in advance!

---

<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:** [May 3, 2023, 11:35am UTC](https://forum.opencv.org/t/problem-with-dll-when-trying-to-run-simple-demo-example/13045/2 "2023-05-03T11:35:53Z")

</div>

So many options. Given that opencv\_core470d.dll etc. are contained in `BUILD_DIR/bin` and lets say your running `opencv_example.exe` you could:

1. Change the Debugging command to point to the version in the bin directory. e.g. Replace `$(TargetPath)` in **Properties-\>Debugging-\>Command** with `BUILD_DIR/bin/opencv_example.exe`
2. Add `BUILD_DIR/bin` to the Working Directory. e.g. Replace `$(ProjectDir)` in **Properties-\>Debugging-\>Working Directory** with `BUILD_DIR/bin`
3. Add `BUILD_DIR/bin` to your **user** (need to restart Visual Studio) or **system** (need to restart windows) path variable either in the command line (set) or GUI (search Edit the System Environment Variables).

---

<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, 12:54pm UTC](https://forum.opencv.org/t/problem-with-dll-when-trying-to-run-simple-demo-example/13045/3 "2023-05-03T12:54:59Z")

</div>

Hi @cudawarped, the last approach seems to be the best according to me, I will give it a try.  
Thanks again!

---

<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:27pm UTC](https://forum.opencv.org/t/problem-with-dll-when-trying-to-run-simple-demo-example/13045/4 "2023-05-03T13:27:23Z")

</div>

> [@dnn](#):
>
> [OpenCV: How to build applications with OpenCV inside the "Microsoft Visual Studio"](https://docs.opencv.org/4.x/dd/d6e/tutorial_windows_visual_studio_opencv.html)

Warning  
This tutorial can contain obsolete information.
