41

I'm trying to use api.ai C++ library on Windows 7. (https://github.com/api-ai/libapiai) But i can not configuring that files..

I installed CMake and MinGW.

in build directory -> cmake .. -G "MinGW Makefiles" -> Error !!

===>>> error is below <<<

CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindCURL.cmake:61 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:45 (find_package)

I don't know how can I solve. what is curl_library? I can use that on Windows 7? not linux/unix etc..

7 Answers 7

64

Try installing curl with the dev libraries:

sudo apt update &&
sudo apt upgrade &&
sudo apt install curl libcurl4-openssl-dev
Sign up to request clarification or add additional context in comments.

2 Comments

This is the correct answer. You need the curl development package to get the curl headers and libraries you need.
@Jabberwock That's the correct answer for Linux, not for Mac OS or Windows. The question is clearly targeting Windows.
28

If you are using Ubuntu: sudo apt-get install libcurl4-openssl-dev

If you are using Centos: sudo yum install libcurl-devel

Comments

15

Just search the internet for curl! It's a library to transfer data with an URL syntax. You can download binaries from it's download page or download the source code and compile it locally. If you use NuGet, you can grab their package instead.

If it is installed, delete your CMakeCache.txt file and re-run CMake. If you don't want to install it, pass -DCURL_LIBRARY=<curl_lib_path> -DCURL_INCLUDE_DIR=<curl_include_path to your CMake call.

5 Comments

Thank you so much. I built that cURL with VS2012 and I got libcurl.dll, libcurl.lib, and several header files in include folder. But I don't know correct PATH... I still have same error. Where should i do to copy that library files? Is it Cmake directory or MinGW directory or api.ai directory? I really appreciate your teaching.
I worked! Thank you. Can i have any further questions? I still have some error.
I commanded 'make install', however cmd returned just _Microsoft Windows [Version 6.1.7601] Copyright ... _. And I can not run the INSTALL because there only exist Makefile, CTestTestfile.cmake, cmake_install.cmake, and directories... help me. really thank you.
"Just search the internet" should not be considered the correct answer. Josh's or Muhammad Mubashir's answer should be the correct one
As far as I can tell, my answer is the only one addressing "what is curl_library?".
15

My issue was fixed by,(installed libssl-dev addtionally to @Josh answer)

sudo apt-get install curl
sudo apt-get install libssl-dev libcurl4-openssl-dev

CMAKE_USE_SYSTEM_CURL is ON but a curl is not found

Comments

1

In fedora, install libcurl-devel

sudo dnf install libcurl-devel

Comments

0

I had the same error on Astra Linux operating system. This code helped fix it:

sudo apt install libcurl4-openssl-dev

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
0

If you are on Alpine Linux, try installing libcurl-dev to fix the error:

sudo apk add curl-dev

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.