# CMake able to find libuv on Linux but not on Windows if installed via vcpkg

**URL:** https://discourse.cmake.org/t/cmake-able-to-find-libuv-on-linux-but-not-on-windows-if-installed-via-vcpkg/14173
**Category:** Usage
**Created:** [May 28, 2025, 4:00am UTC](https://discourse.cmake.org/t/cmake-able-to-find-libuv-on-linux-but-not-on-windows-if-installed-via-vcpkg/14173 "2025-05-28T04:00:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![HallofFamer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@HallofFamer](https://discourse.cmake.org/u/HallofFamer)
#### Post date: [May 28, 2025, 4:00am UTC](https://discourse.cmake.org/t/cmake-able-to-find-libuv-on-linux-but-not-on-windows-if-installed-via-vcpkg/14173/1 "2025-05-28T04:00:31Z")

</div>

Hi,

I am running into a strange issue building my project using CMake. The project depends on curl and libuv, and it works perfectly good on Linux once I install them both manually. On windows however, I use vcpkg together with CMake, and this gives me a problem. For some reason, CMake is able to find and load Curl just fine, but it is unable to find vcpkg.

Below is a snippet of the code I am using in my CMakesLists.txt file

```auto
if (MSVC)
    find_package(CURL CONFIG REQUIRED)
    target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
    target_link_libraries(${PROJECT_NAME} PRIVATE uv)
else ()
    find_package(CURL REQUIRED)
    target_link_libraries(${PROJECT_NAME} CURL::libcurl)
    target_link_libraries(${PROJECT_NAME} uv)
endif()

```

Yeah I am aware that find\_package command does not work for libuv, though strangely enough this issue only emerged recently. Everything was working fine a year ago, suddenly CMake and vcpkg do not seem to work together to find libuv. Can someone please help? Also if there is a way to install packages on Windows without vcpkg, plz lemme know too.

---

<div class="post-metadata">

### Author: ![HallofFamer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@HallofFamer](https://discourse.cmake.org/u/HallofFamer)
#### Post date: [May 29, 2025, 2:44am UTC](https://discourse.cmake.org/t/cmake-able-to-find-libuv-on-linux-but-not-on-windows-if-installed-via-vcpkg/14173/2 "2025-05-29T02:44:19Z")

</div>

Bump, can anyone please help? I have no idea why it was working before and suddenly I am getting this Link error?

`LINK : fatal error LNK1181: cannot open input file 'uv.lib' [C:\Users\Administrator\MyProject\build\MyProject.vcxproj]`
