<?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 Include in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248524#M9643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am constantly having errors that something has been duplicated in another file.&amp;nbsp; I have global data (structure) that is declared in a file called main.h. Any other file that needs this data cannot see it, so I add #include "main.h" which causes errors. &lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is like you have to write all you code in one huge file to use global values. Split the code into separate files and you cannot use them. Why is the language so restrictive. If not then how do you do it.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a simple test problem that shows the problem.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339005"&gt;Include_Test.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Aug 2013 05:30:45 GMT</pubDate>
    <dc:creator>rayhall</dc:creator>
    <dc:date>2013-08-10T05:30:45Z</dc:date>
    <item>
      <title>Include</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248524#M9643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am constantly having errors that something has been duplicated in another file.&amp;nbsp; I have global data (structure) that is declared in a file called main.h. Any other file that needs this data cannot see it, so I add #include "main.h" which causes errors. &lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is like you have to write all you code in one huge file to use global values. Split the code into separate files and you cannot use them. Why is the language so restrictive. If not then how do you do it.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a simple test problem that shows the problem.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339005"&gt;Include_Test.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Aug 2013 05:30:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248524#M9643</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2013-08-10T05:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Include</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248525#M9644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in your code, you define variable "map" in the main.h file. thus each time you include the main.h in one c file, the "map" is defined. that's equals to you define "map" multi times in your project.&lt;/P&gt;&lt;P&gt;to correct it, you need define map in c file and&amp;nbsp; declare it as&amp;nbsp; external in .h file.&lt;/P&gt;&lt;P&gt;i modified your code. see attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Aug 2013 10:24:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248525#M9644</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2013-08-10T10:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Include</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248526#M9645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had tried that before and got errors. The other change you made was the to put typedef before the struct. With this it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Aug 2013 21:35:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248526#M9645</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2013-08-10T21:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Include</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248527#M9646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are welcome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 02:46:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Include/m-p/248527#M9646</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2013-08-12T02:46:41Z</dc:date>
    </item>
  </channel>
</rss>

