<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How do I include a library in a new project?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7746/how-do-i-include-a-library-in-a-new-project</link><description>Probably a silly question, but I am new to Nordic Semiconductor and can&amp;#39;t figure this out. I am trying to make a new project based on the Template example for nrf51422_xxac_s100 and am getting an error when I try to include the &amp;quot;ble_nus.h&amp;quot; library that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 27 Sep 2015 07:55:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7746/how-do-i-include-a-library-in-a-new-project" /><item><title>RE: How do I include a library in a new project?</title><link>https://devzone.nordicsemi.com/thread/27587?ContentTypeID=1</link><pubDate>Sun, 27 Sep 2015 07:55:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fec34844-ea33-401c-93f9-840988009359</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;A library generally contains a library_name.h file and a library_name.c file. If using the .zip style architecture, you need to include both files in your project. When you have included the files in your project, you can use the library by calling its various functions.&lt;/p&gt;
&lt;p&gt;To include the library_name.h file, start with adding the path to the library_name.h file as Øyvind has described in his answer. Additionally, type the following at the top of your main.c file or whatever file you want to call call the library from:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include library_name.h
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the library also contains a .c file, then you must include that also with the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open &amp;quot;Manage Project Items&amp;quot; by clicking (1)&lt;/li&gt;
&lt;li&gt;Click (2) and add the group &amp;quot;nRF_Libraries&amp;quot; if it not already exists&lt;/li&gt;
&lt;li&gt;Select &amp;quot;nRF_Libraries&amp;quot; and click (3) to add library_name.c file to the &amp;quot;nRF_Libraries&amp;quot; group&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Capture-_2D00_-including-library-c-file.JPG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;Now you should be able to use the library and call its various functions.&lt;/p&gt;
&lt;p&gt;If you compile and get errors that files are missing or can not be found, you should add those files (.h and perhaps also .c files) into your project in the same way as described here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I include a library in a new project?</title><link>https://devzone.nordicsemi.com/thread/27586?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 09:34:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35ec7b1b-440a-4a7c-9151-c9585c8fbd11</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to add the include path, to do this for a .zip style architecture do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Click Options for Project(1)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the C/C++ header(2)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click ... (3)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/include_5F00_path.png" alt="image description" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Add the path to the header you want to include&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click OK&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hopefully this works for you, best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I include a library in a new project?</title><link>https://devzone.nordicsemi.com/thread/27585?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 21:12:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fc83db8-4327-4803-9a3e-af5285a07d6f</guid><dc:creator>wlgrd</dc:creator><description>&lt;p&gt;You need to add the include paths for this service. With pack, click the &amp;quot;Manage Run-Time Environment&amp;quot; button:&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/btn.png" alt="button" /&gt;&lt;/p&gt;
&lt;p&gt;and check off the ble_nus (nordic uart service) from nRF_BLE-&amp;gt;BLE_Services-&amp;gt;ble_nus &lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/rte.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;and remember to click &amp;quot;OK&amp;quot; at the bottom.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>