{"id":2643,"date":"2016-08-08T14:49:22","date_gmt":"2016-08-08T14:49:22","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2643"},"modified":"2016-08-08T14:52:16","modified_gmt":"2016-08-08T14:52:16","slug":"c-or-c-libraries","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/libraries\/c-or-c-libraries","title":{"rendered":"C or C++ Libraries"},"content":{"rendered":"<h4>\nInstalling the correct version of a C\/C++library<br \/>\n<\/h4>\n<p>\nOften a library will have a seperate install for C or C++ and you need to install the correct one! &nbsp;Sounds&nbsp;obvious but with so many libraries&nbsp;having poor documentation this can be a simple thing that consfuses the hell out of you. &nbsp;Take for instance the libconfig library:\n<\/p>\n<h5>\nThe C Version<br \/>\n<\/h5>\n<p>\nInstalling\n<\/p>\n<pre>\r\n<code>\r\nsudo apt-get install libconfig-dev\r\n<\/code><\/pre>\n<p>\nUsing\n<\/p>\n<pre>\r\n<code>\r\n#include &lt;libconfig.h&gt;\t\t\t\/\/This library needs the &quot;-lconfig&quot; adding to Project Properties &gt; Build &gt; Linker &gt; Libraries\r\n<\/code><\/pre>\n<h5>\nThe C++ Version<br \/>\n<\/h5>\n<p>\nInstalling &nbsp;\n<\/p>\n<pre>\r\n<code>sudo apt-get install libconfig++-dev\t\t\/\/&lt;&lt;&lt;&lt;NOTICE THE DIFFERENT LIBRARY NAME!\r\n<\/code><\/pre>\n<p>\nUsing\n<\/p>\n<pre>\r\n<code>\r\n#include &lt;libconfig.h++&gt;\t\t\t\/\/This library needs the &quot;-lconfig++&quot; adding to Project Properties &gt; Build &gt; Linker &gt; Libraries\r\nusing namespace libconfig;\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing the correct version of a C\/C++library Often a library will have a seperate install for C or C++ and you need to install the correct one! &nbsp;Sounds&nbsp;obvious but with so many libraries&nbsp;having poor documentation this can be a simple thing that consfuses the hell out of you. &nbsp;Take for instance the libconfig library: The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-2643","post","type-post","status-publish","format-standard","hentry","category-libraries"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2643","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=2643"}],"version-history":[{"count":3,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2643\/revisions"}],"predecessor-version":[{"id":2646,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2643\/revisions\/2646"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}