<?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>C++ in NRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54056/c-in-nrf9160</link><description>Hey, 
 
 I was wondering if I can write C++ code for the NRF9160: 
 
 Does the NRF9160 DK support C++? 
 Is SEGGER IDE compatible with it? 
 Is it recommended to use C++ in it? 
 
 
 Thanks in advance! 
 Tal</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Nov 2019 12:31:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54056/c-in-nrf9160" /><item><title>RE: C++ in NRF9160</title><link>https://devzone.nordicsemi.com/thread/218815?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 12:31:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da287840-8ab6-4072-ad2c-5bc262c48bd1</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;As &lt;a href="https://devzone.nordicsemi.com/members/mojo"&gt;Mojo&lt;/a&gt; says, you can use any language as long as the compiler supports the Cortex M33.&lt;/p&gt;
&lt;p&gt;When it comes to using C++ with the nRF Connect SDK, that is not recommended.&lt;/p&gt;
&lt;p&gt;The Zephyr Project does support C++ using &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kconfig/CONFIG_CPLUSPLUS.html#cmdoption-arg-config-cplusplus"&gt;CONFIG_CPLUSPLUS&lt;/a&gt;&lt;span&gt;&amp;nbsp;and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kconfig/CONFIG_LIB_CPLUSPLUS.html#cmdoption-arg-config-lib-cplusplus"&gt;CONFIG_LIB_CPLUSPLUS&lt;/a&gt;&lt;/span&gt;, although it is still experimental. The up-stream tracking issue is here: &lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/18554"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/18554&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When it comes to NRF, NRFXLIB, and MCUBOOT, I am not sure how well they support C++.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The main.c file must have a .cpp suffix for the build system to recognize that it should use a CXX compiler.&amp;nbsp;See &lt;em&gt;zephyr\samples\cpp_synchronization\src\main.cpp&lt;/em&gt; for a working C++ sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, I would recommend using C unless you have a very good reason for using C++. That way, it will be more tested, and we will be more able to help you if you encounter any problems.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Didrik&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C++ in NRF9160</title><link>https://devzone.nordicsemi.com/thread/218661?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 16:59:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db331474-094b-4b56-88b9-e3ae3020c4de</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;- The DK is a board. &amp;nbsp;You can program it with any language you want as long as there is a compiler supporting the Cortex-M33. &amp;nbsp;C, C++, Python, etc...&lt;/p&gt;
&lt;p&gt;- The Segger IDE does not properly supports C++. &amp;nbsp;Although it uses GCC, it stripped out&amp;nbsp;most C++ support of GCC. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;- C++ or not is a matter of tastes. &amp;nbsp;I use C++ mainly in any embedded project. There are a lot of advantage to it. You can use C++ without real object design as most people do. &amp;nbsp;Arduino, mBed are all C++. &amp;nbsp;C++ is not slower than C as many lead to believe. &amp;nbsp;It is the same performance. &amp;nbsp;Performance is directly related the coder himself. &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;C is a subset of C++. &amp;nbsp;Sample compiler for both. &amp;nbsp;Any well written C code are always and must be 100% compatible with C++. &amp;nbsp;If not, it is considered bad coding.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>