<?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>LPCXpresso IDEのトピックRe: LPCXpresso: Unable to add a header file (undefined reference error)</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656544#M32767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. If you want to put source into the folder, then you need to create a&lt;EM&gt; Source Folder&lt;/EM&gt;. Its on the same&amp;nbsp;menu.&lt;/P&gt;&lt;P&gt;2. When you create a header file, if it is not in the same folder as the file being compiled, you need to&amp;nbsp;add the folder to the include path&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;Right click project -&amp;gt; Properties -&amp;gt; C/C++ Build -&amp;gt; Setting -&amp;gt; MCU C Compiler -&amp;gt; Include paths (-l)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The "Undefined reference" error is a Linker problem, not a compile problem. I guess this is because you have not put led.c into a Source Folder and so it is not being compiled and linked into your application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2017 08:55:55 GMT</pubDate>
    <dc:creator>converse</dc:creator>
    <dc:date>2017-03-16T08:55:55Z</dc:date>
    <item>
      <title>LPCXpresso: Unable to add a header file (undefined reference error)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656543#M32766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to separate led code in a different file&amp;nbsp;and I am facing following issues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue #1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I Created a new folder by&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Right clicking project -&amp;gt; New -&amp;gt; Folder -&amp;gt; Folder name = led.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Now when I try to &amp;nbsp;create a header file and source file by&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Right clicking project -&amp;gt; New -&amp;gt; Header File/Source File, I could &amp;nbsp;not find "led" folder which I just created. Why is led &amp;nbsp;&amp;nbsp;&amp;nbsp;folder not there?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Issue #2&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If I create a header file and source file by&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Right clicking project -&amp;gt; New -&amp;gt; File -&amp;gt; File name = led.h and File name = led.c, and #include "led.h" in my &amp;nbsp;&amp;nbsp;&amp;nbsp;hello_world_core1.c file,&amp;nbsp;the program is not compiling&amp;nbsp;and gives me the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;fatal error: led.h: No such file or directory hello_world_core1.c /hello_world_cm0plus/source line 44 C/C++ Problem&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If I manually include led.h header file&amp;nbsp;in the Include files (-include) by&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Right clicking project -&amp;gt; Properties -&amp;gt; C/C++ Build -&amp;gt; Setting -&amp;gt; MCU C Compiler -&amp;gt; Include files&lt;SPAN&gt;&amp;nbsp;(-include)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt;&amp;nbsp;${workspace_loc:/${ProjName}/led/led.h}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I get the same error&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;fatal error: led.h: No such file or directory hello_world_core1.c /hello_world_cm0plus/source line 44 C/C++ Problem&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Now if I&amp;nbsp;&lt;SPAN&gt;manually include led.h header file in the Include Paths (-l) by&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Right clicking project -&amp;gt; Properties -&amp;gt; C/C++ Build -&amp;gt; Setting -&amp;gt; MCU C Compiler -&amp;gt; Include paths (-l)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt;&amp;nbsp;${workspace_loc:/${ProjName}/led}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;the previous fatal error disappears&amp;nbsp;and but it gives me a new error about a function &lt;SPAN style="background-color: #f6f6f6;"&gt;UpdateLED()&amp;nbsp;&lt;/SPAN&gt;which I am calling from &amp;nbsp;&amp;nbsp;&amp;nbsp;led.c.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;undefined reference to `UpdateLED' hello_world_core1.c /hello_world_cm0plus/source line 119 C/C++ Problem&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 07:59:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656543#M32766</guid>
      <dc:creator>kembed</dc:creator>
      <dc:date>2017-03-16T07:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: LPCXpresso: Unable to add a header file (undefined reference error)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656544#M32767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. If you want to put source into the folder, then you need to create a&lt;EM&gt; Source Folder&lt;/EM&gt;. Its on the same&amp;nbsp;menu.&lt;/P&gt;&lt;P&gt;2. When you create a header file, if it is not in the same folder as the file being compiled, you need to&amp;nbsp;add the folder to the include path&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;Right click project -&amp;gt; Properties -&amp;gt; C/C++ Build -&amp;gt; Setting -&amp;gt; MCU C Compiler -&amp;gt; Include paths (-l)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The "Undefined reference" error is a Linker problem, not a compile problem. I guess this is because you have not put led.c into a Source Folder and so it is not being compiled and linked into your application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 08:55:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656544#M32767</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2017-03-16T08:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: LPCXpresso: Unable to add a header file (undefined reference error)</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656545#M32768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Con,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying a program to get LCD output. My whole program compiles and gives an error lpc_types.h : No such file or directory. I have lpc_types.h header in one of my created lcd.h header file. How to add that header file through the steps you have mentioned above. Please Help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Dec 2017 10:03:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPCXpresso-Unable-to-add-a-header-file-undefined-reference-error/m-p/656545#M32768</guid>
      <dc:creator>somduttacharya</dc:creator>
      <dc:date>2017-12-14T10:03:03Z</dc:date>
    </item>
  </channel>
</rss>

