# Problem with findpackage(CURL REQUIRED) and precompiled curl 7.68.0 for Windows

**URL:** https://discourse.cmake.org/t/problem-with-findpackage-curl-required-and-precompiled-curl-7-68-0-for-windows/686
**Category:** Usage
**Created:** [February 23, 2020, 4:57pm UTC](https://discourse.cmake.org/t/problem-with-findpackage-curl-required-and-precompiled-curl-7-68-0-for-windows/686 "2020-02-23T16:57:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kerstin\_Keller](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kerstin_keller/32/180_2.png) [@Kerstin\_Keller](https://discourse.cmake.org/u/Kerstin_Keller)
#### Post date: [February 23, 2020, 4:57pm UTC](https://discourse.cmake.org/t/problem-with-findpackage-curl-required-and-precompiled-curl-7-68-0-for-windows/686/1 "2020-02-23T16:57:36Z")

</div>

Hi,

I am using CMake 3.16.3 and having problems with the provided FindCurl.cmake script.  
I have unzipped the precompiled version downloaded from the curl website in a given location and set both `CMAKE_PREFIX_PATH` and `CMAKE_MODULE_PATH` to that location.

CMake can locate the version and header files just fine, but fails with the library:  
`Could NOT find CURL (missing: CURL_LIBRARY) (found version "7.68.0")`

I think it might be due to the fact that the precompiled package contains `libcurl.a` and `libcurl.dll.a`, while I am building with Visual Studio? However, since curl is a C Library, that should not be a problem.  
Is this considered to be a bug in `FindCurl.cmake` or any tips on how I can make it correctly locate the library?

---

<div class="post-metadata">

### Author: ![Kerstin\_Keller](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kerstin_keller/32/180_2.png) [@Kerstin\_Keller](https://discourse.cmake.org/u/Kerstin_Keller)
#### Post date: [February 23, 2020, 5:38pm UTC](https://discourse.cmake.org/t/problem-with-findpackage-curl-required-and-precompiled-curl-7-68-0-for-windows/686/2 "2020-02-23T17:38:02Z")

</div>

I restested with CMake 3.17.0-rc1 and it’s the same behavior.

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [February 24, 2020, 9:49am UTC](https://discourse.cmake.org/t/problem-with-findpackage-curl-required-and-precompiled-curl-7-68-0-for-windows/686/3 "2020-02-24T09:49:40Z")

</div>

The problem is effectively about the library suffix. Your package was built with `mingw64` toolchain which use `.dll.a` as extension for import library and `.a` for static library.

With Visual Studio toolchain, expected extension for import and static libraries is `.lib`.  
Try to extend variable [CMAKE\_FIND\_LIBRARY\_SUFFIXES](https://cmake.org/cmake/help/git-master/variable/CMAKE_FIND_LIBRARY_SUFFIXES.html) with your suffixes.

```cmake
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")

```

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 24, 2020, 10:41am UTC](https://discourse.cmake.org/t/problem-with-findpackage-curl-required-and-precompiled-curl-7-68-0-for-windows/686/4 "2020-02-24T10:41:43Z")

</div>

It won’t help you directly here, but in case others come across this thread later or those generating the curl packages are interested, the [GNUtoMS](https://cmake.org/cmake/help/latest/prop_tgt/GNUtoMS.html) target property can be used to direct CMake to also generate a `.lib` from the `.dll.a` file. This would need to be done when building the library, not consuming it though and it requires the Visual Studio tools to be available.
