<?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>CodeWarrior for MCU中的主题 Re: C1815 Error When Variable is Already Declared</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176780#M5760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This makes symbol asm_main visible to other modules:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDEF asm_main&lt;/P&gt;&lt;P&gt;without XDEF you would be unable to reference asm_main from any other C or ASM file. You should XDEF all variables you are trying to reference from main.c.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDEF&amp;nbsp; RAM_line1, RAM_line2, RAM_line3, RAM_line4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Feb 2010 00:47:18 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2010-02-18T00:47:18Z</dc:date>
    <item>
      <title>C1815 Error When Variable is Already Declared</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176779#M5759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a project right now, and am having an annoying problem. The project is mostly done in C, with a few variable declarations in main.asm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Codewarrior isn't recognizing the variables I'm declaring in main.asm. If I right-click the variable in main.c and select "Go to delcaration of X", it will go to the main.asm file where I declared it.&lt;/P&gt;&lt;P&gt;However, when I try to debug the project, the compiler says the variable hasn't been declared. Here are a few snippits of my code...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAIN.ASM (the important variables here are the RAM_Lines)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;; export symbols&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDEF asm_main&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; we use export 'Entry' as symbol. This allows us to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; reference 'Entry' either in the linker .prm file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; or from C/C++ later on&lt;BR /&gt;&lt;BR /&gt;; Include derivative-specific definitions&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;INCLUDE 'derivative.inc' &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;; variable/data section&lt;BR /&gt;DEFAULT_RAM: SECTION&lt;BR /&gt;; Insert here your data definition.&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;temp_byte ds.b 1&lt;BR /&gt;RAM_line1 ds.b 16&lt;BR /&gt;RAM_line2 ds.b 16&lt;BR /&gt;RAM_line3 ds.b 16&lt;BR /&gt;RAM_line4 ds.b 16&lt;BR /&gt;SCI_RX_buf ds.b 16&lt;BR /&gt;&lt;BR /&gt;; code section&lt;BR /&gt;MyCode:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SECTION&lt;BR /&gt;&lt;BR /&gt;; this assembly routine is called by the C/C++ application&lt;BR /&gt;asm_main:&lt;BR /&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MOVB&amp;nbsp;&amp;nbsp; #1,temp_byte&amp;nbsp;&amp;nbsp; ; just some demonstration code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Insert here your own code&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; return to caller&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAIN.C&lt;/P&gt;&lt;P&gt;void main(void) {&lt;/P&gt;&lt;P&gt;EnableInterrupts;&lt;BR /&gt;asm_main();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;strncpy(&amp;amp;RAM_line1[0],&amp;amp;line1[0],16);&amp;nbsp; //Before we start, we copy down the intro screen from&lt;BR /&gt;strncpy(&amp;amp;RAM_line2[0],&amp;amp;line2[0],16);&amp;nbsp; // flash into the RAM buffer used for the LCD&lt;BR /&gt;strncpy(&amp;amp;RAM_line3[0],&amp;amp;line3[0],16);&lt;BR /&gt;strncpy(&amp;amp;RAM_line4[0],&amp;amp;line4[0],16);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once Codewarrior gets to strncpy(&amp;amp;RAM_line1[0],&amp;amp;line1[0],16);, it gives me an error (C1815), for all of the lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;None of this is my code, it's code one of my teachers is having us put in our project. The project itself isn't about fixing this error, so I should be OK in posting this annoying error here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adriano&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 23:57:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176779#M5759</guid>
      <dc:creator>AdrianoE</dc:creator>
      <dc:date>2010-02-17T23:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: C1815 Error When Variable is Already Declared</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176780#M5760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This makes symbol asm_main visible to other modules:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDEF asm_main&lt;/P&gt;&lt;P&gt;without XDEF you would be unable to reference asm_main from any other C or ASM file. You should XDEF all variables you are trying to reference from main.c.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDEF&amp;nbsp; RAM_line1, RAM_line2, RAM_line3, RAM_line4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Feb 2010 00:47:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176780#M5760</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-02-18T00:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: C1815 Error When Variable is Already Declared</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176781#M5761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the delayed reply, but thanks it does work now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 07:22:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C1815-Error-When-Variable-is-Already-Declared/m-p/176781#M5761</guid>
      <dc:creator>AdrianoE</dc:creator>
      <dc:date>2010-02-26T07:22:06Z</dc:date>
    </item>
  </channel>
</rss>

