user1304765
user1304765

Reputation: 247

Libcurl OpenSSL not found

This is extremely annoying. I've been trying to solve this for weeks... I've successfully built libcurl with OpenSSL but this piece of code keeps returning false. I guess my last choice is to find a pre-built library (DLL Release - DLL OpenSSL). Edit: Forgot to add that I tried all the relevant solutions I could find and none of them worked. BTW this is for VS

curl_version_info_data * vinfo = curl_version_info(CURLVERSION_NOW);
if (vinfo->features & CURL_VERSION_SSL)
    MessageBoxA(0, "Yes", 0, 0);
else
    MessageBoxA(0, "No", 0, 0);

Upvotes: 1

Views: 1966

Answers (1)

Sergei Nikulov
Sergei Nikulov

Reputation: 5110

Here the my step-by-step instruction how to build Curl with OpenSSL using CMake and Visual Studio (any version)

Pre-requisites:

  1. Installed Microsoft Visual Studio
  2. Installed CMake
  3. Build and install OpenSSL development libraries as described here (in my case I've installed it here C:\WORK\MSVC2013.64\openssl using perl Configure --prefix=C:\WORK\MSVC2013.64\openssl ...)

Step-by-step procedure:

git clone https://github.com/bagder/curl.git
cd curl
mkdir b.msvc
cd b.msvc
cmake .. -G"Visual Studio 12 2013 Win64" -DOPENSSL_ROOT_DIR=C:\WORK\MSVC2013.64\openssl

When CMake runs, be sure that OpenSSL is found

-- Found OpenSSL: C:/WORK/MSVC2013.64/openssl/lib/ssleay32.lib;C:/WORK/MSVC2013. 64/openssl/lib/libeay32.lib (found version "1.0.2a")

When all done without error, you'll find solution file CURL.sln which can be opened in Visual Studio or just build it with command

cmake --build . --config Release

Then check, if it was built with OpenSSL enabled

C:\WORK\GitHub\curl\b.msvc\src\Release>curl.exe --version
curl 7.42.0-DEV (Windows) libcurl/7.29.1-DEV OpenSSL/1.0.2a
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: NTLM SSL

Another thing - you can provide following option to cmake

-DCMAKE_INSTALL_PREFIX= < path to where you want install curl/libcurl >

Then

cmake --build . --config Release --target INSTALL

will install curl/libcurl to provided location

Hope this helps.

Upvotes: 1

Related Questions