# What happens when vs\_link\_exe copies dependent exes?

**URL:** https://discourse.cmake.org/t/what-happens-when-vs-link-exe-copies-dependent-exes/2290
**Category:** Code
**Created:** [December 3, 2020, 11:25pm UTC](https://discourse.cmake.org/t/what-happens-when-vs-link-exe-copies-dependent-exes/2290 "2020-12-03T23:25:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alex/32/125_2.png) [@alex](https://discourse.cmake.org/u/alex)
#### Post date: [December 3, 2020, 11:25pm UTC](https://discourse.cmake.org/t/what-happens-when-vs-link-exe-copies-dependent-exes/2290/1 "2020-12-03T23:25:39Z")

</div>

I’m getting loader errors from a CMake project I work on (Halide). Here’s what I observe:

I have Halide.dll in my installed directory. It has md5sum `8676341266e7f5ceb450b98df32f00ab` and size 87210496 bytes.

When I try to compile a project that uses the CMake package including it, it creates a “copy” in the same folder as my executable with md5sum `b5acb133d83224cc40c77431723b1897` and size 86905856 bytes.

The latter is missing exports that I can see in the former. I’m beyond confused.  
If I _manually_ copy the former Halide.dll over the latter, things work.

Using CMake 3.19 (also tried with 3.18, same deal) and `WINDOWS_EXPORT_ALL_SYMBOLS` is on.

---

<div class="post-metadata">

### Author: ![alex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alex/32/125_2.png) [@alex](https://discourse.cmake.org/u/alex)
#### Post date: [December 3, 2020, 11:45pm UTC](https://discourse.cmake.org/t/what-happens-when-vs-link-exe-copies-dependent-exes/2290/2 "2020-12-03T23:45:55Z")

</div>

It was actually vcpkg preferring the installed version of my package from its tree rather than the development one I was working on. That behavior is wild.

Removing Halide from vcpkg fixed it. So would have setting `-DVCPKG_APPLOCAL_DEPS=NO`.

I’ll leave this Q/A up for anyone who runs into similar issues developing a package that is _also_ upstreamed in vcpkg.

The first error message I got was:

> The procedure entry point […] could not my located in the dynamic link library
