{"id":1967,"date":"2015-05-28T12:08:26","date_gmt":"2015-05-28T12:08:26","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=1967"},"modified":"2015-10-27T16:21:13","modified_gmt":"2015-10-27T16:21:13","slug":"adding-libraries","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/compilers-and-ides\/netbeans-windows\/adding-libraries","title":{"rendered":"Adding Libraries"},"content":{"rendered":"<h4>\nAdding A Library To A&nbsp;NetBeans&nbsp;Project<br \/>\n<\/h4>\n<p>\n<em>For example the bcm2835 library for the IO pins.<\/em>\n<\/p>\n<p>\nInclude&nbsp;the library header file\n<\/p>\n<pre>\r\n<code>#include &lt;bcm2835.h&gt;<\/code><\/pre>\n<p>\nWhen you compile you the compiler also needs to include the library so the libraries object file is added to the final compilation.\n<\/p>\n<p>\nRight click the project &gt; Properties &gt; Build &gt; Linker &gt; In the &#39;Libraries&#39; section press the &#39;&#8230;&#39; button &gt; Add Option&#8230; &gt; Other Option &gt; Enter your libraries option, e.g.:&nbsp;-lbcm2835\n<\/p>\n<h4>\nCommand line options<br \/>\n<\/h4>\n<p>\nFor example the mysql libraries require this:\n<\/p>\n<p>\nProject Properties &gt; Build &gt; Linker &gt; Compilation Line &gt; Additional Options &gt; paste in this:<code> `mysql_config --cflags` `mysql_config --libs` <\/code>\n<\/p>\n<p>\n(Note the single quote marks are correct and should be used!)\n<\/p>\n<h4>\nExamples Of Adding More Complex Libraries<br \/>\n<\/h4>\n<p>\nThis can be handy if you need to work out how to include library directories, options, etc:\n<\/p>\n<p>\n<a href=\"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/gui-programming-in-c\/gtk\/installing-gtk\">GTK graphics library<\/a>\n<\/p>\n<p>\n<a href=\"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/mysql\/setup-mysql-c-access\">My SQL library<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding A Library To A&nbsp;NetBeans&nbsp;Project For example the bcm2835 library for the IO pins. Include&nbsp;the library header file #include &lt;bcm2835.h&gt; When you compile you the compiler also needs to include the library so the libraries object file is added to the final compilation. Right click the project &gt; Properties &gt; Build &gt; Linker &gt; In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95],"tags":[],"class_list":["post-1967","post","type-post","status-publish","format-standard","hentry","category-netbeans-windows"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1967","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=1967"}],"version-history":[{"count":3,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1967\/revisions"}],"predecessor-version":[{"id":2254,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1967\/revisions\/2254"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=1967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=1967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=1967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}