<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C/C++ Undefined Reference Problem in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599248#M7532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not good at c/c++. I wanted to implement my own source codes (for example SPI&amp;nbsp;with registers) so in the source folder of the project with main.c, I have mySPI.cpp and mySPI.h file. I added #include &amp;lt;mySPI.h&amp;gt; to main.c but it cannot see the functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i call one of the function like SPI_Configure() from mySPI.cpp it says "undefined reference to SPI_Configure"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a simple question but i need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Mar 2017 15:01:43 GMT</pubDate>
    <dc:creator>snricmn</dc:creator>
    <dc:date>2017-03-20T15:01:43Z</dc:date>
    <item>
      <title>C/C++ Undefined Reference Problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599248#M7532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not good at c/c++. I wanted to implement my own source codes (for example SPI&amp;nbsp;with registers) so in the source folder of the project with main.c, I have mySPI.cpp and mySPI.h file. I added #include &amp;lt;mySPI.h&amp;gt; to main.c but it cannot see the functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i call one of the function like SPI_Configure() from mySPI.cpp it says "undefined reference to SPI_Configure"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a simple question but i need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 15:01:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599248#M7532</guid>
      <dc:creator>snricmn</dc:creator>
      <dc:date>2017-03-20T15:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: C/C++ Undefined Reference Problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599249#M7533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ahmet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please add&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;extern&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; 

&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;into your mySPI.c file to have a try.&lt;/P&gt;&lt;P&gt;I also attached a project as your&amp;nbsp; said&amp;nbsp; , there is no error,&amp;nbsp; I use the KDS v3.2 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice Yang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 05:28:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599249#M7533</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2017-03-21T05:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: C/C++ Undefined Reference Problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599250#M7534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice_Yang, thanks for help your way led me to the solutions. I needed to add cplusplus notation to your suggestion.&lt;/P&gt;&lt;P&gt;This below works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#ifdef __cplusplus&lt;BR /&gt;extern "C" {&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#ifdef __cplusplus&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Have a nice day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 11:50:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/C-C-Undefined-Reference-Problem/m-p/599250#M7534</guid>
      <dc:creator>snricmn</dc:creator>
      <dc:date>2017-03-21T11:50:07Z</dc:date>
    </item>
  </channel>
</rss>

