<?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 QorIQのトピックatof</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214948#M4635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i write this simple code for mcf51jm128 and the compiler send this error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;" Link Error&amp;nbsp;&amp;nbsp; : Undefined : "atof" Referenced from "main" in main.c "&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Link Error&amp;nbsp;&amp;nbsp; : Undefined : "atoi"&amp;nbsp; Referenced from "main" in main.c "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;static char s[] = "-49.3";&lt;/P&gt;&lt;P&gt;static char t[]= "125";&lt;/P&gt;&lt;P&gt;float f;&lt;/P&gt;&lt;P&gt;int i;&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; f = atof(s);&lt;BR /&gt;&amp;nbsp; i = atoi(t);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Sep 2009 05:31:54 GMT</pubDate>
    <dc:creator>Emoretti</dc:creator>
    <dc:date>2009-09-09T05:31:54Z</dc:date>
    <item>
      <title>atof</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214948#M4635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i write this simple code for mcf51jm128 and the compiler send this error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;" Link Error&amp;nbsp;&amp;nbsp; : Undefined : "atof" Referenced from "main" in main.c "&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Link Error&amp;nbsp;&amp;nbsp; : Undefined : "atoi"&amp;nbsp; Referenced from "main" in main.c "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;static char s[] = "-49.3";&lt;/P&gt;&lt;P&gt;static char t[]= "125";&lt;/P&gt;&lt;P&gt;float f;&lt;/P&gt;&lt;P&gt;int i;&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; f = atof(s);&lt;BR /&gt;&amp;nbsp; i = atoi(t);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 05:31:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214948#M4635</guid>
      <dc:creator>Emoretti</dc:creator>
      <dc:date>2009-09-09T05:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: atof</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214949#M4636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This means that you do not link the corresponding library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a new project with the wizard to see which libraries to use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or read&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help\PDF\ColdFireV1_Build_Tools_Reference.pdf, chapter 20, ColdFire Runtime Libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 11:43:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214949#M4636</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-09-09T11:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: atof</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214950#M4637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;helo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;i ´am create a new project with the wizard and load this libraries, I´am uninstal and instal codwarrior and send Link Error&amp;nbsp;&amp;nbsp; : Undefined : "atof"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;plese help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fp_coldfire_nodiv.a&lt;/P&gt;&lt;P&gt;C_4i_CF_RegABI_MATH_MSL.a&lt;/P&gt;&lt;P&gt;C_4i_CF_RegABI_Runtime.a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or read&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help\PDF\ColdFireV1_Build_Tools_Reference.pdf, chapter 20, ColdFire Runtime Libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2009 01:14:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214950#M4637</guid>
      <dc:creator>Emoretti</dc:creator>
      <dc:date>2009-09-10T01:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: atof</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214951#M4638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm,&lt;/P&gt;&lt;P&gt;not sure why those methods are not defined.&lt;/P&gt;&lt;P&gt;atoi can easely be implemented based on strtol:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
int atoi(const char * str){  return(strtol(str, NULL, 10));}&lt;/PRE&gt;&lt;P&gt;For atof all the source code is available, not sure why it is not built into the library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can add those files to your project to get a working atof implementation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ColdFire_Support\msl\MSL_C\MSL_Common\Src\strtold.c&lt;/P&gt;&lt;P&gt;ColdFire_Support\msl\MSL_C\MSL_ColdFire\Src\math_cf.c&lt;/P&gt;&lt;P&gt;ColdFire_Support\msl\MSL_C\MSL_Common\Src\scanf.c&lt;/P&gt;&lt;P&gt;ColdFire_Support\msl\MSL_C\MSL_Common_Embedded\Src\ansi_fp.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As alternative a simple special purpose atof might save a bit of flash space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2009 04:55:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214951#M4638</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-09-11T04:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: atof</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214952#M4639</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 have Codewarrior 6.2 and am compiling for a coldfire V1 chip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I solved this problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Libraries in project&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fp_coldfire_ieee_nodiv.a&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_4i_CF_RegABI_Runtime.a&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_4i_CF_RegABI_MATH_MSL.a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Open up&amp;nbsp; MSL_C.CF.v1.mcp project file.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; a.&amp;nbsp; Set target to MATH 4i ColdFire RegABI&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; b.&amp;nbsp; Open ansi_prefix.CF.v1.h&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1. add &amp;nbsp; #define __CF_USE_FULL_LIBS__ &amp;nbsp; &amp;nbsp; 1&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; at the start of file&amp;nbsp;&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; 2. change #define _MSL_HIWARE_COMP&amp;nbsp; 1 to&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; &amp;nbsp; &amp;nbsp; #define _MSL_HIWARE_COMP &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3. change #define _MSL_C99 &amp;nbsp;&amp;nbsp; 0&amp;nbsp; to&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; &amp;nbsp; &amp;nbsp; #define _MSL_C99 &amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c. add ansi_fp.c to&amp;nbsp; to project it is in directory&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; &amp;lt;wherever Codewarrior instaled&amp;gt;\Coldfire_Support\msl\MSL_C\MSL_Common_Embedded\Src&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; d. build MATH 4i ColdFire RegABI target&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we did everything right it should build fine.&amp;nbsp; And a check mark will appear next to C_4i_CF_RegABI_MATH_MSL.a library in your application project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then viola atof will link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I did this my binary image grew about 6K&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh before I did this I had already done the fix for %f format&lt;/P&gt;&lt;P&gt;working&amp;nbsp; FAQ 28628&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't know if you have to this first to wore out to undo and&lt;/P&gt;&lt;P&gt;see if it matters..&amp;nbsp; But if you want to print floats you will have&lt;/P&gt;&lt;P&gt;to follow FAQ 28628&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2009 07:22:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-QorIQ/atof/m-p/214952#M4639</guid>
      <dc:creator>jky</dc:creator>
      <dc:date>2009-10-28T07:22:57Z</dc:date>
    </item>
  </channel>
</rss>

