<?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>topic Re: Refresh SDK Components breaks SDK Example - &amp;quot;undefined reference to 'main' &amp;quot; in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557262#M4010</link>
    <description>&lt;P&gt;Hi Erich,&lt;BR /&gt;&lt;BR /&gt;The source folders are all blue, no change there.&lt;BR /&gt;&lt;BR /&gt;After more investigation I found the solution. In the beginning of the main source file there is a pre-compile condition:&lt;/P&gt;&lt;DIV class=""&gt;&lt;P&gt;#include "lwip/opt.h"&lt;/P&gt;&lt;P&gt;#if LWIP_IPV4 &amp;amp;&amp;amp; LWIP_RAW &amp;amp;&amp;amp; LWIP_NETCONN &amp;amp;&amp;amp; LWIP_DHCP &amp;amp;&amp;amp; LWIP_DNS&lt;BR /&gt;...&lt;BR /&gt;Entire example program&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;#endif&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;LWIP_RAW and LWIP_DNS are both defined as 0 after refreshing the SDK.&lt;BR /&gt;This means my entire main source file is ignored and greyed out.&lt;BR /&gt;I had to re-build the index in order to catch this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In the original working example (before refreshing SDK) these are defined in "...source/lwipopts.h" as '1'.&lt;BR /&gt;After refreshing the SDK, these are defined in "lwip/opt.h" as '0' and "lwipopts.h" doesn't override them.&lt;BR /&gt;&lt;BR /&gt;Further investigating project properties-&amp;gt;Build Settings-&amp;gt;Includes, the list of include paths was re-organized during the Refresh SDK step.&lt;BR /&gt;&lt;BR /&gt;The solution was that I moved "...\source" folder (containing "lwipopts.h") up on the list. This will override the default definition in "lwip/opt.h":&lt;/P&gt;&lt;DIV class=""&gt;#if !defined LWIP_RAW || defined __DOXYGEN__&lt;BR /&gt;#define LWIP_RAW 0&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;P&gt;with:&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;/* ---------- RAW options ---------- */&lt;BR /&gt;#if !defined LWIP_RAW&lt;BR /&gt;#define LWIP_RAW 1&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;P&gt;in "lwipopts.h&lt;BR /&gt;&lt;BR /&gt;This was rather annoying as I have no idea why Refreshing the SDK would mess up the include paths order...&lt;BR /&gt;&lt;BR /&gt;I hope this helps someone out because the solution might seem trivial but it took about 3hrs of looking, updating IDE/SDK, head scratching, going back and forth reproducing..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More information about this bug in a new discussion&amp;nbsp;&lt;A href="https://community.nxp.com/t5/MCUXpresso-SDK/BUG-quot-Refresh-SDK-Components-quot-Duplicates-Project-Include/m-p/1557282#M4011" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Adam&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 16:47:40 GMT</pubDate>
    <dc:creator>SynchroEng</dc:creator>
    <dc:date>2022-11-21T16:47:40Z</dc:date>
    <item>
      <title>Refresh SDK Components breaks SDK Example - "undefined reference to 'main' "</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557239#M4007</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have a problem refreshing SDK components with LWIP - MQTT SDK example project.&lt;/P&gt;&lt;P&gt;Using the &lt;STRONG&gt;LPCXpresso54628&lt;/STRONG&gt; development board, I import the SDK example project: "&lt;STRONG&gt;lpcxpresso54628_lwip_mqtt_freertos&lt;/STRONG&gt;".&lt;BR /&gt;Installed the latest MCUXpresso &lt;STRONG&gt;11.6.1 IDE&lt;/STRONG&gt; and &lt;STRONG&gt;2.12.0 SDK&lt;/STRONG&gt; for LPCXpresso54628.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I right click project -&amp;gt; SDK Management -&amp;gt; Refresh SDK Components -&amp;gt; OK.&lt;/P&gt;&lt;P&gt;I keep the default FreeRTOS configuration with memory management option 3.&lt;BR /&gt;I fix the "heap_3.c" source file to be included in the build and delete the rest of the "heap_x.c" files.&lt;BR /&gt;&lt;BR /&gt;After building the project I get the error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;c:/nxp/mcuxpressoide_11.6.1_8255/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.6.1.202207200623/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/nxp/mcuxpressoide_11.6.1_8255/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.6.1.202207200623/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-noneeabi/lib/thumb/v7em+fp&lt;BR /&gt;/hard\libcr_nohost_nf.a(_cr__main.o): in function `__main':&lt;BR /&gt;&lt;STRONG&gt;_cr__main.c:(.text.__main+0xa): undefined reference to `main'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Memory region Used Size Region Size %age Used&lt;BR /&gt;PROGRAM_FLASH: 10120 B 512 KB 1.93%&lt;BR /&gt;BOARD_FLASH: 0 GB 16 MB 0.00%&lt;BR /&gt;SRAM_UPPER: 27308 B 160 KB 16.67%&lt;BR /&gt;SRAMX: 0 GB 32 KB 0.00%&lt;BR /&gt;USB_RAM: 0 GB 8 KB 0.00%&lt;BR /&gt;BOARD_SDRAM: 0 GB 16 MB 0.00%&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;collect2.exe: error: ld returned 1 exit status&lt;BR /&gt;make[1]: *** [makefile:69: lpcxpresso54628_lwip_mqtt_freertos.axf] Error 1&lt;BR /&gt;make: *** [makefile:60: all] Error 2&lt;BR /&gt;"make -r -j12 all" terminated with exit code 2. Build might be incomplete.&lt;/P&gt;&lt;P&gt;09:45:54 Build Failed. 4 errors, 0 warnings. (took 5s.536ms)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This can be reproduced with the above minimal steps&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I cannot seem to find any outstanding issues in the code itself, I've gone through comparing the libraries and source files to catch any differences but they are the same.&lt;BR /&gt;&lt;BR /&gt;What could be the issue? Any help would be much appreciated!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Adam&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 14:56:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557239#M4007</guid>
      <dc:creator>SynchroEng</dc:creator>
      <dc:date>2022-11-21T14:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh SDK Components breaks SDK Example - "undefined reference to 'main' "</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557250#M4008</link>
      <description>&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;can you check if your source folders are not excluded from the build?&lt;/P&gt;&lt;P&gt;They should have a 'blue C' like the ones below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErichStyger_0-1669044559180.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/201138iEB0A3E3F822E93DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErichStyger_0-1669044559180.png" alt="ErichStyger_0-1669044559180.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 15:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557250#M4008</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2022-11-21T15:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh SDK Components breaks SDK Example - "undefined reference to 'main' "</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557262#M4010</link>
      <description>&lt;P&gt;Hi Erich,&lt;BR /&gt;&lt;BR /&gt;The source folders are all blue, no change there.&lt;BR /&gt;&lt;BR /&gt;After more investigation I found the solution. In the beginning of the main source file there is a pre-compile condition:&lt;/P&gt;&lt;DIV class=""&gt;&lt;P&gt;#include "lwip/opt.h"&lt;/P&gt;&lt;P&gt;#if LWIP_IPV4 &amp;amp;&amp;amp; LWIP_RAW &amp;amp;&amp;amp; LWIP_NETCONN &amp;amp;&amp;amp; LWIP_DHCP &amp;amp;&amp;amp; LWIP_DNS&lt;BR /&gt;...&lt;BR /&gt;Entire example program&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;#endif&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;LWIP_RAW and LWIP_DNS are both defined as 0 after refreshing the SDK.&lt;BR /&gt;This means my entire main source file is ignored and greyed out.&lt;BR /&gt;I had to re-build the index in order to catch this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In the original working example (before refreshing SDK) these are defined in "...source/lwipopts.h" as '1'.&lt;BR /&gt;After refreshing the SDK, these are defined in "lwip/opt.h" as '0' and "lwipopts.h" doesn't override them.&lt;BR /&gt;&lt;BR /&gt;Further investigating project properties-&amp;gt;Build Settings-&amp;gt;Includes, the list of include paths was re-organized during the Refresh SDK step.&lt;BR /&gt;&lt;BR /&gt;The solution was that I moved "...\source" folder (containing "lwipopts.h") up on the list. This will override the default definition in "lwip/opt.h":&lt;/P&gt;&lt;DIV class=""&gt;#if !defined LWIP_RAW || defined __DOXYGEN__&lt;BR /&gt;#define LWIP_RAW 0&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;P&gt;with:&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;/* ---------- RAW options ---------- */&lt;BR /&gt;#if !defined LWIP_RAW&lt;BR /&gt;#define LWIP_RAW 1&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;P&gt;in "lwipopts.h&lt;BR /&gt;&lt;BR /&gt;This was rather annoying as I have no idea why Refreshing the SDK would mess up the include paths order...&lt;BR /&gt;&lt;BR /&gt;I hope this helps someone out because the solution might seem trivial but it took about 3hrs of looking, updating IDE/SDK, head scratching, going back and forth reproducing..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More information about this bug in a new discussion&amp;nbsp;&lt;A href="https://community.nxp.com/t5/MCUXpresso-SDK/BUG-quot-Refresh-SDK-Components-quot-Duplicates-Project-Include/m-p/1557282#M4011" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Adam&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 16:47:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Refresh-SDK-Components-breaks-SDK-Example-quot-undefined/m-p/1557262#M4010</guid>
      <dc:creator>SynchroEng</dc:creator>
      <dc:date>2022-11-21T16:47:40Z</dc:date>
    </item>
  </channel>
</rss>

