- How To Set-Up libcurl on Visual Studio 2019
- Launching Visual Studio Developer Powershell
- Building libcurl from Source
- Setting-up Project Configuration
- Check If Everything is Set-up Correctly
- Libcurl windows visual studio
- Libcurl windows visual studio
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio
- Latest commit
- Git stats
- Files
- README.md
- How do you properly install libcurl for use in visual studio 2017?
- 1 Answer 1
- Getting LibCurl to work with Visual Studio 2013
How To Set-Up libcurl on Visual Studio 2019
Md. Farhabi Helal Ayon
Oct 23, 2019 · 2 min read
Even though a Windows lover, I should say that working with C++ projects in the Windows environment is not always a pleasant experience. This is mostly due to the challenge of setting up the environment. And sometimes, it is fairly a daunting task. Once everything is set-up, everything becomes smooth and life becomes a lot beautiful. But up until that point, it is one of the worst nightmares driving programmers crazy.
Recently, I tried to work with the libcurl library on my Windows machine and with no surprise, got hit with numerous errors mostly from the linker.
Aft e r investing an appropriate amount of time, I got it to work. So I thought it would be helpful for others to share the steps I followed to get the libcurl to work on my Windows machine without any of that payment in time.
Launching Visual Studio Developer Powershell
The build process requires the Visual Studio Developer Command Prompt or Developer Powershell.
They can be found under Tools -> Command Line on the Visual Studio 2019 Menubar.
I used Powershell and it worked fine. Command Prompt should also work.
Building libcurl from Source
First, download the latest source from the Github.
To generate the tool_hugehelp.c file, run the following command.
Otherwise, during the build, it will fail with the message —
Then, from the winbuild directory, start the build with the following commands.
The build will start. It will take several minutes to finish. Upon finishing, $
Setting-up Project Configuration
1. Create a new /Open an existing C++ project.
2. Open Project Properties.
3. Add $
4. Add $
5. Add CURL_STATICLIB to Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions.
6. In Configuration Properties -> Linker -> Input -> Additional Dependencies, add these followings lines-
- $
\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\lib\libcurl_a.lib - Ws2_32.lib
- Wldap32.lib
- Crypt32.lib
- Normaliz.lib
Check If Everything is Set-up Correctly
Now you can try if everything is working with the following code-
Libcurl windows visual studio
Использование libcurl в Visual Studio .
Выдержка с CURL вебстраницы( http :// curl . haxx . se / )
“Curl – это инструмент для передачи данных в URL- синтаксисе , поддерживающий FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl поддерживает HTTPS сертификаты , HTTP POST, HTTP PUT, FTP загрузки , kerberos, HTTP загрузки через базовую форму , прокси , cookies( куки ), логин + пароль аутентификацию , возобновлением передачи данных , http- прокси — туннели и еще вагон различных трюков .”
В этом документе мы объясняем как использовать CURL , но приводим самые простые способы с минимальным использование файлов из библиотеки CURL . Один раз собрав и запустив такое простое приложение вы сможете изучить и другие особенности CURL и увеличить функциональные возможности вашего проекта.
Этот документ объясняет как сконфигурировать различные части, читая группы новостей, много людей похожие проблемы с использованием dll -файлов, конфигурированием Visual Studio и библиотеки CURL . Поскольку сейчас я имею решения этих проблем, то почему бы не выложить их в виде документа, чтобы другие люди не тратили много времни на поиски этих решений.
Технология Kerberos . Название технологии аутентификации и шифрования с открытым ключом, созданной в середине 1980-х годов в Массачусетском технологическом институте ( MIT ) на базе стандарта DES . Описана в RFC 1510. Kerberos используется в Microsoft Windows начиная с версии 2000. В русском переводе Kerberos — Цербер. Так в древнегреческой мифологии назывался трёхголовый пёс, охранявший вход в подземное царство.
В этом документе использовалась Visual Studio версии 6.0, но все сказанное можно отнести к любой другой версии.
3 Установка библиотеки CURL.
Вам необходимо скачать самые свежие исходники CURL и распаковать архив для дальнейшего использования (для сборки dll и lib файлов).
3.1 Загрузите надлежащие исходники.
Загрузите последнюю версию CURL со страницы загрузки CURL :
При написании этого документа я использовал версию curl -7.9.6. zip
Распакуйте ахрив во временный каталог. При этом вы получите следующую структуру каталогов.
Наши приложения будут использовать dll файлы в среде Windows , поэтому интерес для нас представляет только каталог “ lib ”. Другие файлы и каталоги вы можете рассмотреть нескольоко позже, когда уже создатите свою первую программу. Вам также понадобится каталог “ include ” вместе со всеми заголовочными файлами внутри.
3 Компиляция библиотеки CURL.
Перейдите в каталог “ lib ” и двойным шелчком откройте файл “ curlib . dsw ”, являющийся файлом проекта Visual Studio библиотеки CURL . Этим вы запустите Visual Studio с нужной конфигурацией и установками. Понятно, что для этого у вас уже должен быть установлен пакет Visual Studio .
Когда проект будет открыт, нажмите кнопку “ Build ”, чтобы скомпилировать файлы и скомпоновать проект:
Libcurl windows visual studio
Batch script to download and build libcurl (using Visual Studio compiler)
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Auto download & compile libcurl
This batch script will automatically download the latest libcurl source code and build it using Visual Studio compiler.
Supported Visual Studio are:
- Visual C++ 6 (require Windows Server 2003 Platform SDK released in February 2003)
- Visual Studio 2005
- Visual Studio 2008
- Visual Studio 2010
- Visual Studio 2012
- Visual Studio 2013
- Visual Studio 2015
Note-1: All versions of Visual Studio Express are unsupported.
Note-2: This script is using third-party open source software
How do you properly install libcurl for use in visual studio 2017?
I am just starting out in c++ and cannot figure out how to add libraries, in particular libcurl. I tried a bunch of tutorials but most were for 2013/10 or didn’t work. Can anyone please explain (Preferably in standard/non technical English) how I can add the library? I have already tried adding it in the include section of the program and in the additional dependencies menu.
Note this is a re-post I asked virtually the same question around 3 days ago to which I received no replies. Not sure if that is because its very easy and I should have figured it out my self, or if it just got buried in a flood of questions, or some other reason. In any case sorry for the re-post.
1 Answer 1
Here’s how I’ve got curl to work with Visual Studio 2017 15.9.14:
- Download curl zip package from https://curl.haxx.se/download.html (latest verified is: https://curl.haxx.se/download/curl-7.70.0.zip)
- Extract downloaded package to a folder of your choice (e.g. C:\curl\ )
- Open Developer Command Prompt for VS 2017 (see Windows Start menu or %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\ ) and cd to C:\curl\winbuild\
- Run nmake /f Makefile.vc mode=static . This will build curl as a static library into C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\
- Create a new project in Visual Studio (e.g. a Windows Console Application )
- In Project Properties -> VC++ Directories -> Include Directories add C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\include\
- In Project Properties -> VC++ Directories -> Library Directories add C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\lib\ there
- In Project Properties -> Linker -> Input -> Additional Dependencies add libcurl_a.lib , Ws2_32.lib , Crypt32.lib , Wldap32.lib and Normaliz.lib
- Try to build a sample program:
Alternatively you can use vcpkg to install curl:
Getting LibCurl to work with Visual Studio 2013
I am having trouble getting LibCurl to work with Visual Studio 2013. I downloaded the current version (curl-7.33.0) and tried following the instructions I found on this site: Using LibCurl with Visual 2010
But I can’t find curllib.lib in the folder I downloaded. And I am still getting errors:
After searching the internet for more help. I now get these error messages. There appears to be a problem with linking to libcurl.lib?
This is what I have configured:
Inside /lib I have libcurl.lib and libcurl.dll
UPDATE
I downloaded this release for Win32 MSVC: http://curl.haxx.se/download.html#Win32 After adding the libcurl libraries and successfully compiling, I am now getting this error message:
Here is the sample code I am trying to run:
FINAL UPDATE
I believe I have gotten LibCurl to work with Visual Studio 2013 now. Persistence ftw! Although, after spending hours trying to solve these error messages, I am a little hesitant at saying everything is working fine now. That is why I am putting a bounty on this question to get clear and concise instructions on getting LibCurl to work with Visual Studio 2013.
This is what I did to get it to work:
First, download the Win32 MSVC package here: http://curl.haxx.se/download.html#Win32 For these instructions sake, let’s say you downloaded to C:\LibCurl
Start a new project in Visual Studio. Go to Project|Project Properties|VC++ Directories|Include Directories| Add the path to the include directory inside the downloaded package. (C:\LibCurl\include)
Next, go to Project|Project Properties|Linker|General|Additional Library Directories| Add the path to the lib directory. (Where curllib.dll is located)
Then, go to Project|Project Properties|Linker|Input|Additional Dependencies| And add curllib.lib
Now if you compile a test program, you will likely get the message saying libsasl.dll is missing. You will need to download this file and put it in the same directory as your build. I used 7-Zip to extract libsasl.dll from OpenLDAP for Windows. OpenLDAP for Windows
This is the result of my test code from above: