<?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>Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40456/compiler-error-unimplemented-non-trival-error</link><description>Hello, 
 I am using SDK 15.0.0, Segger IDE with GNU compiler (GNU++11, GNU11). 
 I am using the default serial example from SDK 15.0.0 with C source file. But when i switch the default serial code from C source file. to C++ source file, i am getting an</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Dec 2018 21:51:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40456/compiler-error-unimplemented-non-trival-error" /><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162388?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 21:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6971c7ad-cf3f-4c0c-851c-3906c4dbdb18</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;pragmatist!&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162386?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 21:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03d40095-06ea-40c5-828b-57b56b832186</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;so what, it compiles no issues&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162385?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 21:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51177763-610f-49f3-8cb4-dbbd26625d2d</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;It works fine with CLANG just complaining in GNU GCC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162384?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 21:23:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcccf4c9-8fc8-4593-abdc-6cb270f60c59</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;I did proper ordering in my c++ main file and wherever it required in c library files. And its working fine without error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162382?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 21:09:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:277e5644-7318-4826-9594-24ab2cf71ac7</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Some googling suggests that it&amp;#39;s C++ &lt;strong&gt;20&lt;/strong&gt; - not 11 - which introduces designated initialisers?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/18731707/why-does-c11-not-support-designated-initializer-lists-as-c99"&gt;https://stackoverflow.com/questions/18731707/why-does-c11-not-support-designated-initializer-lists-as-c99&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.cppreference.com/w/cpp/language/aggregate_initialization"&gt;https://en.cppreference.com/w/cpp/language/aggregate_initialization&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The latter includes the note:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;Note: out-of-order designated initialization, nested designated initialization, mixing of designated initializers and regular initializers, and designated initialization of arrays are all supported in the&amp;nbsp;&lt;a title="c/language/struct initialization" href="https://en.cppreference.com/w/c/language/struct_initialization"&gt;C programming language&lt;/a&gt;, but are not allowed in C++.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162376?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 20:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49033e98-c869-4a53-88da-87f4a727bedb</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Wrong, set the compiler option to ISO C++ 11 (not GNU C++ 11), you&amp;#39;ll see it compiles. &amp;nbsp;I am using GCC 7 btw.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162375?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 20:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c23c52d5-5d5f-45ee-8bd3-e7eba16788b2</guid><dc:creator>awneil</dc:creator><description>[quote userid="74018" url="~/f/nordic-q-a/40456/compiler-error-unimplemented-non-trival-error"]i am getting an error &amp;quot;&amp;nbsp;Unimplemented Non-Trival Error &amp;quot;[/quote]
&lt;p&gt;You mean this:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19750/sorry-unimplemented-non-trivial-designated-initializers-not-supported"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/19750/sorry-unimplemented-non-trivial-designated-initializers-not-supported&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162372?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 19:43:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8960edcd-6fe3-43fc-8f91-b22ace351aac</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;that is C++ 11&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162360?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 17:11:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28442b84-6d93-46c4-b51d-20fb8b12fedb</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Is that&amp;nbsp;compliant with the Standard, or is that a GCC extension - as mentioned above?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162358?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 17:02:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d260deb6-56e4-4053-bfda-c02e5cf4a7db</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Actually you can use the field name in the initialization. &amp;nbsp;Only thing require it to work with C++ is the ordering. &amp;nbsp;it has to be in the same order as declared in the struct. &amp;nbsp;For instance if your struct is declared x then y. &amp;nbsp;You need to init as { .x= 1, .y = 2 } not { .y =2, .x =1 }. &amp;nbsp;The later will generate the error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162263?ContentTypeID=1</link><pubDate>Tue, 18 Dec 2018 11:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8007afcd-3d42-4dd8-aa43-044cc133d575</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I assume you also removed the field name, to fix the initialization issue in C++.&lt;/p&gt;
&lt;p&gt;So rather than initialize like this {.field1 = x, .field2 = y}, you just initialize like this {x, y}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162168?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 19:16:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ebfa2f6-6a14-4c02-92af-576b89bf9a97</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;Mine is working perfectly fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162162?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 18:17:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8a4ef49-b17b-4e73-b079-d2332f9b8e4c</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;that would not help with the initialisation issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162161?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 18:13:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f174e082-3dc1-4f9f-be5c-2e3311d72ad5</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;I just changed the parameters in those functions which are using type def struct in macros.&lt;/p&gt;
&lt;p&gt;as an example, if there are 7 different type of variable in structure in macros. But you want to change the value of only 3 or 4 parameters. so, instead of that use all the variables in your function but with the default values. (You can change the value if you want ).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And sequence of variables should be same as type def struct.&lt;/p&gt;
&lt;p&gt;I am using&amp;nbsp;&lt;span&gt;GNU++11 and GNU11&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162160?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 18:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0c10c1f-9195-4fd2-93f2-6057673b7c78</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;I just changed the parameters in those functions which are using type def struct in macros.&lt;/p&gt;
&lt;p&gt;as an example, if there are 7 different type of variable in structure in macros. But you want to change the value of only 3 or 4 parameters. so, instead of that use all the variables in your function but with the default values. (You can change the value if you want ).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And sequence of variables should be same as type def struct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162102?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 14:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:772536b9-9b63-4835-8dce-7314c6a7f6b5</guid><dc:creator>awneil</dc:creator><description>[quote userid="74018" url="~/f/nordic-q-a/40456/compiler-error-unimplemented-non-trival-error"] i am getting an error &amp;quot;&amp;nbsp;Unimplemented Non-Trival Error &amp;quot;[/quote]
&lt;p&gt;It would help if you gave the complete message - copied &amp;amp; pasted - unabridged and unedited.&lt;/p&gt;
&lt;p&gt;Also the section of code to which it relates.&lt;/p&gt;
&lt;p&gt;It sounds, as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt;&amp;nbsp;suggests, like GCC is complaining about C-style structure initialisations which are not supported by C++&lt;/p&gt;
&lt;p&gt;As a language &lt;em&gt;extension&lt;/em&gt;, GCC does offer some &amp;quot;trivial&amp;quot;&amp;nbsp; C-style initialisations in C++ - so that could be what the message is referring to.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT&lt;/p&gt;
&lt;p&gt;Is this the full message you were getting:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19750/sorry-unimplemented-non-trivial-designated-initializers-not-supported"&gt;devzone.nordicsemi.com/.../sorry-unimplemented-non-trivial-designated-initializers-not-supported&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/162058?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 12:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ea6d8d9-7d36-4cad-abc0-48270f119c4f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That is good to hear!&lt;/p&gt;
&lt;p&gt;Do you mind sharing which files you had to change to make it work?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/161295?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 18:13:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f8eb3fd-a2e4-47c7-a887-3d0b90346cb3</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;I have solved the problem.&lt;/p&gt;
&lt;p&gt;There is minor change in typedef struct they are using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler Error: Unimplemented Non-Trival Error</title><link>https://devzone.nordicsemi.com/thread/157321?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 14:01:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe39a465-3852-4a80-94a8-c0ce8ce00f5e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately there is no straight forward way to use C++ with the nRF5 SDK. Many of the SDK files use syntax which is not supported in C++, such as the way many structs and unions are initialized.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is a request internally to make the SDK C++ compliant, but this is not a high priority task, so it is unknown if or when it will be fixed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>