<?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>8-bit MicrocontrollersのトピックRe: Link Error: L1822: Symbols are undefined</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212337#M18320</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;The issue here is that you are calling a function implemented in an ANSI C module from a C++ module.&lt;/DIV&gt;&lt;DIV&gt;If this is really what you want to do you need to tell the compiler you are doing that.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is done enclosing function prototypes from your ANSI C module between&lt;/DIV&gt;&lt;DIV&gt;#ifdef __cplusplus&lt;BR /&gt;extern "C" {&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So your module TIMERAPI.h should look as follows:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;#ifdef __cplusplus&lt;BR /&gt;extern "C" {&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;void Delayus(unsigned int us);&lt;BR /&gt;void Delayms(unsigned int ms);&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note that V3.0 was behaving exactly in the same way. I assume in V3.0 you were building a file called main.c or you did use an option to force compilation of .cpp file as ANSI C source files.&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>Mon, 05 Jan 2009 18:56:06 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2009-01-05T18:56:06Z</dc:date>
    <item>
      <title>Re: Link Error: L1822: Symbols are undefined</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212336#M18319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HI:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for these days i´m trying to migrate my whole work on microcontrolers (proyects) from Metrowerks CW 3.0 to Freescale CW 6.2 with some problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for example, with some libraries that doesn't link to their declarations on the main program.&amp;nbsp;&amp;nbsp; when compile the proyect some errors and warnings appear:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Link Error&amp;nbsp; : L1822: Symbol Delayms_FUi in file C:// .....&amp;nbsp; ..... is undefined&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;also with other "symbols".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the code from .h file where Delayms is declared:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "derivative.h" /* include peripheral declarations */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifndef __TIMERAPI_H&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define __TIMERAPI_H&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void Delayus(unsigned int us);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void Delayms(unsigned int ms);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif /* __TIMERAPI_H */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the code on the header of the main program:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "derivative.h" /* include peripheral declarations */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "TIMERAPI.h" /*include Delays declarations*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "STEPPERAPI.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;plus, errors seems to apear on .O files from proyect_data\ObjectCode\main.ccp.o&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;those errors didn't appear in my old version of CW from Metrowerks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What can i do ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mauricio&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 09:26:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212336#M18319</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2008-12-24T09:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Link Error: L1822: Symbols are undefined</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212337#M18320</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;The issue here is that you are calling a function implemented in an ANSI C module from a C++ module.&lt;/DIV&gt;&lt;DIV&gt;If this is really what you want to do you need to tell the compiler you are doing that.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is done enclosing function prototypes from your ANSI C module between&lt;/DIV&gt;&lt;DIV&gt;#ifdef __cplusplus&lt;BR /&gt;extern "C" {&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So your module TIMERAPI.h should look as follows:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;#ifdef __cplusplus&lt;BR /&gt;extern "C" {&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;void Delayus(unsigned int us);&lt;BR /&gt;void Delayms(unsigned int ms);&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note that V3.0 was behaving exactly in the same way. I assume in V3.0 you were building a file called main.c or you did use an option to force compilation of .cpp file as ANSI C source files.&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>Mon, 05 Jan 2009 18:56:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212337#M18320</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2009-01-05T18:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Link Error: L1822: Symbols are undefined</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212338#M18321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi&lt;BR /&gt;Thanks, maybe i should continue creating C based proyect instead of C++, so your solution seems to be very interesting&lt;BR /&gt;&lt;BR /&gt;using C support instead C++, my module did't present that linking problem, but i had to change some of the prototype's definitions, defining my functions as extern functions.&lt;BR /&gt;&lt;BR /&gt;in this moment i'm working well!!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 10:52:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Re-Link-Error-L1822-Symbols-are-undefined/m-p/212338#M18321</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2009-01-13T10:52:27Z</dc:date>
    </item>
  </channel>
</rss>

