<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31195/failing-to-compile-thread-example-after-updating-openthread-library</link><description>Hi all, I tried to modify the OpenThread&amp;#39;s source codes(Just modify an API) and then built them. 
 
 Run the build_gcc_libs.bat script to build all of the libraries. That&amp;#39;s OK. 
 After the libraries are built, use the provided script ( &amp;lt;InstallFolder</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Oct 2018 10:23:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31195/failing-to-compile-thread-example-after-updating-openthread-library" /><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/153609?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2018 10:23:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24ec5c31-fed9-49b9-9b57-7fc9b8373792</guid><dc:creator>Rufy</dc:creator><description>&lt;p&gt;Hello Robert&lt;/p&gt;
&lt;p&gt;I &lt;span&gt;use windows gcc, too, and&amp;nbsp;&lt;/span&gt;encounter build fail today.&lt;/p&gt;
&lt;p&gt;My environment :&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;OS: windows 7
nordic sdk version:&amp;#160;nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac.zip
openthread git version:&amp;#160;71d4ad3e777672a441e238344290df302ad86bb7&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I follow Nordic online document (&lt;a href="https://goo.gl/nH3bYu"&gt;https://goo.gl/nH3bYu&lt;/a&gt;) to setup environment.&lt;/p&gt;
&lt;p&gt;After updating the latest openthread project from github, the ble_thread_dyn_template example can&amp;#39;t build successfully.&lt;/p&gt;
&lt;p&gt;My error log:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Linking target: _build/nrf52840_xxaa.out
../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(instance.cpp.o): In function `ot::Instance::Instanc
e()&amp;#39;:
E:\Proj\nordic\_threadwc\trunk\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/com
mon/instance.cpp:90: undefined reference to `ot::LinkRaw::LinkRaw(ot::Instance&amp;amp;)&amp;#39;
../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(mac.cpp.o): In function `otPlatRadioEnergyScanDone&amp;#39;
:
E:\Proj\nordic\_threadwc\trunk\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/mac
/mac.cpp:402: undefined reference to `ot::LinkRaw::InvokeEnergyScanDone(signed char)&amp;#39;
../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(mac.cpp.o): In function `otPlatRadioReceiveDone&amp;#39;:
E:\Proj\nordic\_threadwc\trunk\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/mac
/mac.cpp:1859: undefined reference to `ot::LinkRaw::InvokeReceiveDone(otRadioFrame*, otError)&amp;#39;
../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(mac.cpp.o): In function `otPlatRadioTxDone&amp;#39;:
E:\Proj\nordic\_threadwc\trunk\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/mac
/mac.cpp:1306: undefined reference to `ot::LinkRaw::InvokeTransmitDone(otRadioFrame*, otRadioFrame*, otError)&amp;#39;
collect2.exe: error: ld returned 1 exit status
make: *** [_build/nrf52840_xxaa.out] Error 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t work even I modify makefile&amp;nbsp;&lt;strong&gt;libopenthread-platform-utils.a&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;into&amp;nbsp;&lt;/span&gt;&lt;strong&gt;libopenthread-nrf52840-sdk.a.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/125207?ContentTypeID=1</link><pubDate>Tue, 20 Mar 2018 15:11:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a9ee251-2569-457a-a0d9-828f46ec92b3</guid><dc:creator>Robert Lubos</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for reporting this issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have identified two problems with the linker after updating OpenThread with libraries build with GCC on Windows.&lt;/p&gt;
&lt;p&gt;First of all,&amp;nbsp;&lt;strong&gt;libopenthread-platform-utils.a&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is not included in makefiles for our examples. The reason for that is that OpenThread build system silently merges&amp;nbsp;&lt;strong&gt;libopenthread-platform-utils.a&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;into&amp;nbsp;&lt;strong&gt;libopenthread-nrf82840-sdk.a&lt;/strong&gt;. Our GCC projects for Windows don&amp;#39;t do that, therefore the problem with missing references to&amp;nbsp;&lt;span&gt;otPlatSettingsSet etc. We are going to fix that in next release.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To fix that problem, modify the Makefile you are using to build your project, and include the missing library:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Libraries common to all targets
LIB_FILES += \
  $(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-cli-ftd.a \
  $(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-ftd.a \
  $(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-platform-utils.a \
  $(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-nrf52840-sdk.a \
  $(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-diag.a \
  $(SDK_ROOT)/external/openthread/lib/gcc/libmbedcrypto-cc310.a \
  $(SDK_ROOT)/external/nrf_cc310/lib/libcc310_gcc_0.9.0.a \&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kepp the order of the libraries as in the snippet above, otherwise you may still encounter issues with missing symbols during executable linking (unfortunately&amp;nbsp;linking order makes difference to ld).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The second issue I&amp;#39;ve identified is that for some reason, when we use libraries build on Windows, they are missing some C++ runtime sybmbols. To fix that, you need to explicitly tell the linker to use C++ stdlib. To do that, again, modify the project Makefile and replace:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;LIB_FILES += -lc -lnosys -lm&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;with the following:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;LIB_FILES += -lc -lnosys -lm -lstdc++&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Applying both of the proposed solutions should fix your linking errors.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Best Regards,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Robert&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/124575?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 12:39:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e479c29-f889-4563-a2e3-9cae528c74ef</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;yes, I did ..&amp;nbsp; that is why I contacted the team :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/124111?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 09:52:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a997e3e1-91ff-4df2-9554-5a928e376ea6</guid><dc:creator>Carry Irving</dc:creator><description>&lt;p&gt;Thank you~&lt;/p&gt;
&lt;p&gt;By the way, have you reproduced this error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/124103?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 09:23:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:748f5d4e-913d-481e-8662-d75e9507ce62</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;contacted the thread team for this. Will come back to you soon when i get response from them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/123541?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 05:50:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68999adc-2c92-4ba4-9e7b-3e3e083f3494</guid><dc:creator>Carry Irving</dc:creator><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/how-to-reproduce-the-error.txt"&gt;devzone.nordicsemi.com/.../how-to-reproduce-the-error.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to compile Thread example after updating OpenThread library</title><link>https://devzone.nordicsemi.com/thread/123356?ContentTypeID=1</link><pubDate>Thu, 08 Mar 2018 08:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ea60617-f462-487c-9d24-76265a46112f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;can you help us reproduce this error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>