<?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>LPCXpresso IDE中的主题 Re: strtof gets Undefined reference</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533702#M3728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Thu Jan 30 02:09:55 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;strtof is a floating point function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think thar your libraries are compiled without support for floating point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to use an integer function instead. Or switch to libraries which are compiled with floating point support (== more code size).&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:10:45 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:10:45Z</dc:date>
    <item>
      <title>strtof gets Undefined reference</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533701#M3727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mspahr on Wed Jan 29 18:20:13 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I started my project with an example from "LPCWare/LPC11xx/Downloads/Software/Sample code bundle for LPC11xx peripherals using NXP LPCXpresso".&amp;nbsp; The project is USB ROM MSC.&amp;nbsp; I have built on this base.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am usinf LPCXpresso V5.2.6 with LPC11U35.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to use stdlib function strtof.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the source c file I have #include stdlib.h&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The file compiles OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The linker gives the error "undefine reference to strtok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have checked that the MCU compiler and MCU linker target are set to redlib.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed the MCU linker target setting from redlib(none) to redlib(semihost), also tried (nohost).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It still fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I noticed under the linker general tab that the box "no startup or default libs" is checked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I unchecked this and it compiles and links OK, but it has added 24k of code and when run, it gets a hard fault.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help.&amp;nbsp; I need to use several functions from redlib.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:10:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533701#M3727</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: strtof gets Undefined reference</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533702#M3728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Thu Jan 30 02:09:55 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;strtof is a floating point function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think thar your libraries are compiled without support for floating point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to use an integer function instead. Or switch to libraries which are compiled with floating point support (== more code size).&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:10:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533702#M3728</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: strtof gets Undefined reference</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533703#M3729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Thu Jan 30 02:15:52 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;strtof() is actually a C99 library function. Redlib is a &lt;/SPAN&gt;&lt;A href="http://http://www.lpcware.com/content/faq/lpcxpresso/redlib-and-newlib" rel="nofollow noopener noreferrer" target="_blank"&gt;C90 library implementation with some C99 functions provided&lt;/A&gt;&lt;SPAN&gt;. Unfortunately in this case it appears that the Redlib header files have got out of step with the source files - in that strtof() is in the header files, but has not yet actually been implemented. We'll investigate getting this fixed for a future release.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The simplest way to fix your problem in the meantime is to provide a version within your code base thus:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;float strtof(const char *str, char **endptr) {
&amp;nbsp; return (float) strtod(str, endptr);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also you should not untick the "no startup or default libs" box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You really should consider upgrading to LPCXpresso 6 (you can install in parallel to your LPCXpresso 5 install if you want)…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpcxpresso-latest-release" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.lpcware.com/content/forum/lpcxpresso-latest-release&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the latest LPCOpen v2 packages all list the actual version of LPCXpresso they were created/tested against - and ALL assume an LPCXpresso 6 install.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:10:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/strtof-gets-Undefined-reference/m-p/533703#M3729</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:10:46Z</dc:date>
    </item>
  </channel>
</rss>

