-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for using static version of libcurl (Visual Studio 14 2015) #196
Comments
Never mind. Visual StudioI am using Visual Studio 14 2015 Win64 for my project. RuntimeYou have to compile all static libraries with the same runtime! OpenSSLIf you want to use OpenSSL, you have to compile that too beforehand. After running nmake -f ms\nt.mak install, you will find all OpenSSL related files under \usr\local\ssl on the same drive. CPR & libcurlNow coming to the main point. set OPENSSL_ROOT_DIR=<drive letter>\usr\local\ssl
set OPENSSL_INCLUDE_DIR=<drive letter>\usr\local\ssl\include
set OPENSSL_LIB=<drive letter>\usr\local\ssl\lib Move to the location where you want the cpr project the be located. Before using cmake, open the CMakeLists.txt file in cpr\opt\curl option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF) with option(CURL_STATICLIB "Set to ON to build libcurl with static linking." ON) Now execute cmake: You should now find a file named cpr.sln in the build folder.
Now you can right click the cpr project and build it. Your ProjectI would recommend creating a folder for all dependencies.
Copy the respective libraries into the Debug/Release folder: cpr.lib, libcurl.lib, libeay32.lib, ssleay32.lib For both Debug and Release:
This should do it. I might have forgot some things, so sorry. |
I have tried to use cpr with the static version of libcurl, but that doesn't seem to work, since libcurl_imp.lib isn't getting build for the static version of libcurl.
And since cpr links to libcurl_imp.lib, I am getting compile errors.
These are the errors:
The text was updated successfully, but these errors were encountered: