<?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>How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57362/how-to-add-c-file-to-nrf9160-project-in-ses</link><description>Hi, 
 I&amp;#39;m not sure if SES support C++ compiler in nRF9160 project, I did add C++ source in CMakeList: 
 target_sources(app PRIVATE src/xxx.cpp) 
 It won&amp;#39;t work, Does anyone know? 
 Thanks, 
 Bertie</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 28 Jun 2020 01:37:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57362/how-to-add-c-file-to-nrf9160-project-in-ses" /><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/257240?ContentTypeID=1</link><pubDate>Sun, 28 Jun 2020 01:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29c4f3e8-2e55-4ddc-aaee-7d48d3f81054</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;As I mentioned in previous reply. &amp;nbsp;SES stripped out most C++ headers. &amp;nbsp;This from CrossWork itself but CrossWorks allows you to setup to use external full GCC. SES is a tripped down version of CrossWorks, not sure it supports that. So forget SES if you want to use C++.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/257239?ContentTypeID=1</link><pubDate>Sun, 28 Jun 2020 01:32:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fc3c8d0-1bf2-4683-b1a6-628f51eb33c4</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;SES stripped out most of the header files for C++ from GCC. hence does not compile C++ code. &amp;nbsp;You need to use external full GCC for that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/257236?ContentTypeID=1</link><pubDate>Sat, 27 Jun 2020 20:34:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bdf0b89-8f8e-424d-a9fe-d10c1fca5b97</guid><dc:creator>medard.rieder</dc:creator><description>&lt;p&gt;you should really come up now with C++, it is totally anoying to program in C. Archaic C is in big discrepancy with the complexity of projects you do using NRF91 chips. Please go ahead with this. And stop finding excuses.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards from Switzerland and sorry for the hard, but true words.&lt;/p&gt;
&lt;p&gt;Medard Rieder&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/253334?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 14:22:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8ad3688-7238-4dab-a763-508d2d821152</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/lordlucan"&gt;LordLucan&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I can not comment on future releases, for that, you should contact your Regional Sales Manager. If you do not have the contact details for your RSM, you can send me a private message with your location, and I will provide it to you.&lt;/p&gt;
&lt;p&gt;As mentioned earlier in the case, it should work fine if you build from the command line, but we have not done much, if any, testing with C++.&lt;/p&gt;
&lt;p&gt;Best regards, and sorry for the ,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/253061?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 14:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42f11129-3c08-436c-a637-ade68771c96d</guid><dc:creator>LordLucan</dc:creator><description>&lt;p&gt;I too would like to use C++ (it is 2020 after all!). I&amp;#39;ve set up a test project and on the command line and the support in Zephyr seems remarkably good. You&amp;#39;ve got C++17 standard compiler, streams, lambdas, containers, string etc. My test binary even runs ok on the nrf9160DK :)&lt;/p&gt;
&lt;p&gt;However, the support for C++ in SES is woeful (despite having a ++ symbol on the icon!). SES just does not recognize cpp files at all and won&amp;#39;t even build a project properly that&amp;#39;s configured on the command line. Will the Nordic SES version support C++ properly at some point?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/233446?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 08:44:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d80fb2a9-0404-4353-b6af-3359a61634e8</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and sorry for the slow response.&lt;/p&gt;
&lt;p&gt;We do not have official C++ support in any of our SDKs, so you are mostly on your own here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/233082?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 14:14:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4b6438d-60b2-4655-a106-2fc6c2e12225</guid><dc:creator>bertiew</dc:creator><description>&lt;p&gt;Command line works, thank you.&lt;/p&gt;
&lt;p&gt;do you know what is the problem of SES with C++? Command line build is not so convenient for us.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/232881?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 15:08:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d41aa32e-b20c-445d-ac3f-27b5391b483b</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;I just tried myself, and it does indeed look like SES has some problems with C++.&lt;/p&gt;
&lt;p&gt;However, the attached project worked fine when building from the command line.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-941d18f2bf5845ff9a8f8b3c70ddc035/hello_5F00_world_5F00_cpp.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_cpp.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note that I had to disable (or rather, not set) CONFIG_LIB_CPLUSPLUS to make it compile.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/232660?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 16:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f31fb907-8d64-4b3f-945a-f997ffee6fd0</guid><dc:creator>bertiew</dc:creator><description>&lt;p&gt;Thanks Didrik,&lt;/p&gt;
&lt;p&gt;I added&amp;nbsp;CONFIG_CPLUSPLUS=y and&amp;nbsp;CONFIG_LIB_CPLUSPLUS=y in prj.conf&lt;/p&gt;
&lt;p&gt;built it on Window SES. Project can be built but just not compile the .cpp file which is in CMakeLists.&lt;/p&gt;
&lt;p&gt;what I tested is to use &amp;quot;hello world&amp;quot; in&amp;nbsp;zephyr\samples\hello_world:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; changed src/main.c to src/main.cpp, also in CMakeLists&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; added&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_CPLUSPLUS=y and&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_LIB_CPLUSPLUS=y in prj.conf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; Loaded project into SES, and the main.cpp is not in Project &amp;#39;app/libapp.a&amp;#39; list, but main.c was there before modification:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580834990018v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;build and run on&amp;nbsp;nRF9160 DK board won&amp;#39;t print&amp;nbsp;&amp;quot;hello world&amp;quot; on terminal as main.c build does.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Did I miss something?&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: How to add C++ file to nRF9160 project in SES</title><link>https://devzone.nordicsemi.com/thread/232541?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 12:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fe6ea67-ae48-4dd2-9b33-3e012752e0dd</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Did you enable C++ support 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;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you tried building from the command line (you will have to set two environment variables first: ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb and GNUARMEMB_TOOLCHAIN_PATH=&amp;lt;path to your toolchain install directory&amp;gt;)?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;While C++ should be supported in NCS, I do not believe it is much tested, so you are largely on your own.&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></channel></rss>