<?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>Make and call a C function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22799/make-and-call-a-c-function</link><description>Using Keil MDK Lite v 5.22, writing code in C for nRF52, with SDK 12. 
 Example code works. 
 How does one declare a function, define it, and call it? 
 I&amp;#39;ve created a new module: myFunction.c and a header file: myFunction.h. 
 I added a folder under</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Jun 2017 01:24:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22799/make-and-call-a-c-function" /><item><title>RE: Make and call a C function</title><link>https://devzone.nordicsemi.com/thread/89631?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2017 01:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7c7018e-c451-45b2-a2be-3b734b27362c</guid><dc:creator>robinvice</dc:creator><description>&lt;p&gt;OK, I found the problem.  I was expecting there to be some non-ANSI C setting up of function declarations/definitions, but it turned out to be a path problem.&lt;/p&gt;
&lt;p&gt;While looking for a solution, I saw many references to path problems, but at first glance I didn&amp;#39;t think it was the issue here.  Since my header file was located in the same directory as the rest of my project, and the other project files were found, I didn&amp;#39;t think there was a path issue.&lt;/p&gt;
&lt;p&gt;I tested it by placing my header file (myFunction.h) in the same path as stdio.h.  Then my header file worked.&lt;/p&gt;
&lt;p&gt;So, the solution was to open the Windows File Explorer window to the folder where my header file was located and copy the path.  Then I pasted it in the C/C++ Include Paths text box in the Options for Target dialog window at the end of all the other paths.&lt;/p&gt;
&lt;p&gt;I still don&amp;#39;t know why it couldn&amp;#39;t find the header file in the working directory without adding the path.&lt;/p&gt;
&lt;p&gt;Hopefully this will help someone else with similar problems.&lt;/p&gt;
&lt;p&gt;robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>