<?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 Link error in CodeWarrior for a HC08 device in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Link-error-in-CodeWarrior-for-a-HC08-device/m-p/181765#M13289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi to everyone,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm trying to compile some sort of software using CodeWarrior for a HC08 device but I'm having problems with the Linker. In fact I have this header file in which there's the following code:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#ifndef HEADER_H#define HEADER_H/*Register declarations*/#endif&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;This to prevent the linking errors for the header file being included more than once. Even though I've included this code to prevent this, I get a L1818 linking error saying that many registers were actually declared more than once.&lt;/DIV&gt;&lt;DIV&gt;I'm sure that all these registers are declered only once in the previous mentioned header file...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there some sorf of overriding command that ignored my #ifndef code? Is there a way to do something in IDE level?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any reply,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ivan.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:32:13 GMT</pubDate>
    <dc:creator>IvanWagner</dc:creator>
    <dc:date>2020-10-29T09:32:13Z</dc:date>
    <item>
      <title>Link error in CodeWarrior for a HC08 device</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Link-error-in-CodeWarrior-for-a-HC08-device/m-p/181765#M13289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi to everyone,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm trying to compile some sort of software using CodeWarrior for a HC08 device but I'm having problems with the Linker. In fact I have this header file in which there's the following code:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#ifndef HEADER_H#define HEADER_H/*Register declarations*/#endif&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;This to prevent the linking errors for the header file being included more than once. Even though I've included this code to prevent this, I get a L1818 linking error saying that many registers were actually declared more than once.&lt;/DIV&gt;&lt;DIV&gt;I'm sure that all these registers are declered only once in the previous mentioned header file...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there some sorf of overriding command that ignored my #ifndef code? Is there a way to do something in IDE level?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any reply,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ivan.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:32:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Link-error-in-CodeWarrior-for-a-HC08-device/m-p/181765#M13289</guid>
      <dc:creator>IvanWagner</dc:creator>
      <dc:date>2020-10-29T09:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Link error in CodeWarrior for a HC08 device</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Link-error-in-CodeWarrior-for-a-HC08-device/m-p/181766#M13290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Make sure to have only external declaration for your registers in the .h file.&lt;/DIV&gt;&lt;DIV&gt;For example&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; extern unsigned char PORTA;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You need a separate .C source file to hold the actual definition of the registers.&lt;/DIV&gt;&lt;DIV&gt;For example&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; unsigned char PORTA;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;This is a standard programming rule, when you are using modular programming.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can check the register definition file delivered with CodeWarrior to check how this is done.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 23:41:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Link-error-in-CodeWarrior-for-a-HC08-device/m-p/181766#M13290</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-01-22T23:41:03Z</dc:date>
    </item>
  </channel>
</rss>

