{"id":3321,"date":"2020-07-24T07:55:51","date_gmt":"2020-07-24T07:55:51","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3321"},"modified":"2020-07-24T10:33:27","modified_gmt":"2020-07-24T10:33:27","slug":"adding-curl-to-your-project","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/networking\/curl\/adding-curl-to-your-project","title":{"rendered":".Adding curl to your project"},"content":{"rendered":"\n<p>Command line curl is separate to libcurl that you can use in programs.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install curl<\/h4>\n\n\n\n<p>Installing the OpenSSL version<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install libcurl4-openssl-dev<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Using the Library In A NetBeans&nbsp;Project<\/h4>\n\n\n\n<p>Including the library header file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;curl\/curl.h><\/code><\/pre>\n\n\n\n<p>When you compile you also need to include -lcurl\u00a0so the libraries object file is added to the final compilation.<\/p>\n\n\n\n<p>Right click the project > Properties > Build > Linker > In the &#8216;Libraries&#8217; section press the &#8216;\u2026&#8217; button > Add Option\u2026 > Other Option > Enter:\u00a0-lcurl<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Current version<\/h4>\n\n\n\n<p>Seems hard to identify for the install command!<\/p>\n\n\n\n<p>Current version: https:\/\/curl.haxx.se\/changes.html<\/p>\n\n\n\n<p>However install libcurl7-openssl-dev does not work even though its at version 7 currently.  Using command : sudo apt-get install libcurl-dev<br>Gave a response of:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Package libcurl-dev is a virtual package provided by:<\/li><li>libcurl4-openssl-dev 7.38.0-4+deb8u16<\/li><li>libcurl4-nss-dev 7.38.0-4+deb8u16<\/li><li>libcurl4-gnutls-dev 7.38.0-4+deb8u16<\/li><li>You should explicitly select one to install.<\/li><\/ul>\n\n\n\n<p>So libcurl4 it seems to be.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Removing curl<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt remove curl<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Command line curl is separate to libcurl that you can use in programs. Install curl Installing the OpenSSL version Using the Library In A NetBeans&nbsp;Project Including the library header file When you compile you also need to include -lcurl\u00a0so the libraries object file is added to the final compilation. Right click the project > Properties [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[161],"tags":[],"class_list":["post-3321","post","type-post","status-publish","format-standard","hentry","category-curl"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3321"}],"version-history":[{"count":7,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3321\/revisions"}],"predecessor-version":[{"id":3341,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3321\/revisions\/3341"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}