<?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>MCUXpresso GeneralのトピックRe: Including header files problem</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267780#M4149</link>
    <description>&lt;P&gt;It depends on the linker if it flags double definitions. I consider this as a programmer error so having it flagged as an error is a good thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 03:37:48 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2021-04-26T03:37:48Z</dc:date>
    <item>
      <title>Including header files problem</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267679#M4145</link>
      <description>&lt;P&gt;I have problem when including same header file from two different source files I get error from duplicate variables.&lt;/P&gt;&lt;P&gt;Variable is defined in PID.h&lt;/P&gt;&lt;P&gt;I have PID.h that is included in PID.c and main.c.&lt;/P&gt;&lt;P&gt;Now I trying to port my code to work in LPCXpresso.&lt;/P&gt;&lt;P&gt;I have been using eclipse and gcc before, and this same code and files has been working in that environment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;./src/main.o:(.bss.PID+0x0): multiple definition of `PID'&lt;BR /&gt;AHB_SRAM1: 1048 B 32 KB 3.20%&lt;BR /&gt;./src/PID.o:(.bss.PID+0x0): first defined here&lt;BR /&gt;collect2.exe: error: ld returned 1 exit status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Header files are located in separate holder just to keep thing clean.&lt;/P&gt;&lt;P&gt;It's include path is defined as:&lt;/P&gt;&lt;P&gt;"${workspace_loc:/${ProjName}/inc}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 18:26:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267679#M4145</guid>
      <dc:creator>jussikangas</dc:creator>
      <dc:date>2021-04-25T18:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Including header files problem</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267680#M4146</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Variable is defined in PID.h&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's the problem. Header files are for *declarations*, not definitions!&lt;/P&gt;&lt;P&gt;You probably missed the 'exern' in the header file, it shall be for example&lt;/P&gt;&lt;P&gt;extern int pid;&lt;/P&gt;&lt;P&gt;in the header file pid.h und&lt;/P&gt;&lt;P&gt;int pid;&lt;/P&gt;&lt;P&gt;in the pid.c&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 18:39:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267680#M4146</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-04-25T18:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Including header files problem</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267683#M4147</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;That is&amp;nbsp; a way that I use header for declarations and in source files variables are defined.&lt;/P&gt;&lt;P&gt;It seems that my old tool chain handled those pit different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I changed according your advice and now code is build fine.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 19:36:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267683#M4147</guid>
      <dc:creator>jussikangas</dc:creator>
      <dc:date>2021-04-25T19:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Including header files problem</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267780#M4149</link>
      <description>&lt;P&gt;It depends on the linker if it flags double definitions. I consider this as a programmer error so having it flagged as an error is a good thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 03:37:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Including-header-files-problem/m-p/1267780#M4149</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-04-26T03:37:48Z</dc:date>
    </item>
  </channel>
</rss>

