<?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>MCUXpresso IDEのトピックRe: cJSON - undefined reference to __isnan</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212662#M6544</link>
    <description>&lt;P&gt;Exactly my point. The error message does not match the code.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* Render the number nicely from the given item into a string. */
static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)
{
    unsigned char *output_pointer = NULL;
    double d = item-&amp;gt;valuedouble;
    int length = 0;
    size_t i = 0;
    unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */
    unsigned char decimal_point = get_decimal_point();
    double test = 0.0;

    if (output_buffer == NULL)
    {
        return false;
    }

    /* This checks for NaN and Infinity */

    if (isnan(d) || isinf(d))
    {
        length = sprintf((char*)number_buffer, "null");
    }
    else
    { ..........&lt;/LI-CODE&gt;&lt;P&gt;And here is the compiler error:&lt;/P&gt;&lt;P&gt;C:\mcuxpresso_workspace\sdm_01\Debug/../source/cJSON.c:562: undefined reference to `__isnand'&lt;/P&gt;&lt;P&gt;If I CTRL-click on the isnan in the code, then it takes me to the definition in math.h as expected.&lt;/P&gt;&lt;P&gt;So, why the compiler error? The code looks OK to me.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Nick&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 22:28:43 GMT</pubDate>
    <dc:creator>nickwallis</dc:creator>
    <dc:date>2021-01-15T22:28:43Z</dc:date>
    <item>
      <title>cJSON - undefined reference to __isnan</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212598#M6542</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using cJSON is a project but am having an issue building it that I don't understand.&lt;/P&gt;&lt;P&gt;If I include references to cJSON_Print(), then the build fails with an error message "undefined reference to __isnan". This is despite the fact that this is available to the build, in math.h (which is #included).&lt;/P&gt;&lt;P&gt;Why would the build fail in this way, even though the required definition/file is actually there?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;-Nick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 20:12:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212598#M6542</guid>
      <dc:creator>nickwallis</dc:creator>
      <dc:date>2021-01-15T20:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: cJSON - undefined reference to __isnan</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212638#M6543</link>
      <description>&lt;P&gt;The error is for __isnand not isnan...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 21:40:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212638#M6543</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-01-15T21:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: cJSON - undefined reference to __isnan</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212662#M6544</link>
      <description>&lt;P&gt;Exactly my point. The error message does not match the code.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* Render the number nicely from the given item into a string. */
static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)
{
    unsigned char *output_pointer = NULL;
    double d = item-&amp;gt;valuedouble;
    int length = 0;
    size_t i = 0;
    unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */
    unsigned char decimal_point = get_decimal_point();
    double test = 0.0;

    if (output_buffer == NULL)
    {
        return false;
    }

    /* This checks for NaN and Infinity */

    if (isnan(d) || isinf(d))
    {
        length = sprintf((char*)number_buffer, "null");
    }
    else
    { ..........&lt;/LI-CODE&gt;&lt;P&gt;And here is the compiler error:&lt;/P&gt;&lt;P&gt;C:\mcuxpresso_workspace\sdm_01\Debug/../source/cJSON.c:562: undefined reference to `__isnand'&lt;/P&gt;&lt;P&gt;If I CTRL-click on the isnan in the code, then it takes me to the definition in math.h as expected.&lt;/P&gt;&lt;P&gt;So, why the compiler error? The code looks OK to me.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Nick&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 22:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212662#M6544</guid>
      <dc:creator>nickwallis</dc:creator>
      <dc:date>2021-01-15T22:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: cJSON - undefined reference to __isnan</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212665#M6545</link>
      <description>&lt;P&gt;Just to clarify. It is a &lt;STRONG&gt;linker&lt;/STRONG&gt; error not a compiler error. That is, you are missing a library. You need to provide a library to satisfy the isnand function&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 22:54:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1212665#M6545</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-01-15T22:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: cJSON - undefined reference to __isnan</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1219095#M6562</link>
      <description>&lt;P&gt;I got some time to look into this, and on second glance it seemed obvious that Redlib was missing these dependencies, and changing to Newlib has fixed this. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 20:36:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/cJSON-undefined-reference-to-isnan/m-p/1219095#M6562</guid>
      <dc:creator>nickwallis</dc:creator>
      <dc:date>2021-01-21T20:36:51Z</dc:date>
    </item>
  </channel>
</rss>

