<?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>Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4160/programming-nrf51x22-with-keil-in-c</link><description>Hi All, 
 I was wondering if it was possible to program the nrf51x22 in c++? I am using Keil and I&amp;#39;m trying to convert the examples in the SDK to CPP by adding --cpp to the compiler string and 
 #ifdef __cplusplus
extern &amp;quot;C&amp;quot; {
#endif

...

#ifdef</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 13 Feb 2016 12:45:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4160/programming-nrf51x22-with-keil-in-c" /><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14891?ContentTypeID=1</link><pubDate>Sat, 13 Feb 2016 12:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ba04544-06a6-461e-b541-d81d16d25195</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;The LMXDisplayDemo example in C++&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14890?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2016 11:51:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60ebfa60-d4f5-44c2-a7f6-e8e9ea8e4371</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;@Nguyen Yes, I had  look at your blog and also have my setup completed and able to build your sample Blinky and UART BLE examples. However, these are all C projects and I could not find any C++ demo project in it. I tried creating a new C++ project but could not build it successfully.  Could you please share any sample C++ project with BLE soft device enabled? Thanks so much&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14889?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2016 03:46:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b80adab-e9bd-482a-bc40-de44f32a858f</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;@Ric, have you had a look at my blog ? it shows you how to make the SDK work with C++&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14888?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2016 14:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0dc89a1-65ff-4366-a4f0-440255c523d6</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;Hi Everyone,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying follow something similar which you guys I have tried. I&amp;#39;m trying to mix C &amp;amp; C++.  I get the below build error when I try it with GCC and Eclipse.&lt;/p&gt;
&lt;p&gt;make[1]: *** No rule to make target &lt;code&gt;_build/system_nrf51.o&amp;#39;, needed by&lt;/code&gt;nrf51422_xxac_s110&amp;#39;.  Stop.
make: *** [all] Error 2&lt;/p&gt;
&lt;p&gt;As @Nguyen Hoan Hoang has mentioned the SDK also missing the extern &amp;quot;C&amp;quot; encapsulation. One of the SVC call function do not compiles in C++.  Should I believe that the is no way I can compile C++ code with the current SDK. To mention I&amp;#39;m using SDK v10
Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14887?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 14:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:297a2c9b-71f8-4b81-816f-e5fe3b166f3d</guid><dc:creator>AlexDM0</dc:creator><description>&lt;p&gt;Thanks, I got it to compile!
EDIT: I completely agree with azdem..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14886?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 13:47:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f3f7529-398a-4412-a714-d840b4926c00</guid><dc:creator>azdem</dc:creator><description>&lt;p&gt;Thanks for the explanation.
As far as I see, the mbed team has already made the SDK C++ compatible and it is possible to export projects from their online toolchain to Keil or GCC. I have tried that with some online example projects and it seems to work easily.
Why do I want to move to C++?  Because, many open source libraries are written in C++.
So, I would be glad indeed, if Nordic could support the C++ development &lt;strong&gt;directly&lt;/strong&gt;...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14885?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 12:53:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3406a4de-0b45-4a11-b314-7cce211d9d17</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;I don&amp;#39;t know about Keil but the startup code for GCC from the SDK does not work with C++.  It is missing the initialization for C++ runtime library.  All the include from the SDK also missing the extern &amp;quot;C&amp;quot; encapsulation.  One of the SVC call function do not compiles in C++.  See my blog for change require for that function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14884?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 12:20:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cfe1535-34ef-482b-b903-a0fae9d153d4</guid><dc:creator>azdem</dc:creator><description>&lt;p&gt;Does the answer above mean that it is &lt;strong&gt;not&lt;/strong&gt; possible to do C++ development (to be exact, mixing C &amp;amp; C++) &lt;strong&gt;on Keil&lt;/strong&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14883?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 11:03:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d01a7e6d-6bad-4a76-87a9-9d251c40a565</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;it&amp;#39;s in include folder at the top of the tree where all common sources are located.  It&amp;#39;s a multi-platform working tree. The project should have all the require path for it.  I see there is one that was not a relative path and that was the one.  The include path for that should be &amp;quot;${workspace_loc:}/../../../include&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14882?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 09:31:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc91bebd-4f9a-4d60-87a9-0f262898a47f</guid><dc:creator>AlexDM0</dc:creator><description>&lt;p&gt;Turns out &amp;quot;${workspace_loc:/nrf51_sdk/nrf51822/Include/sdk}&amp;quot; is not possible in windows (kepler) so &amp;quot;${workspace_loc}/nrf51_sdk/nrf51822/Include/sdk&amp;quot; worked. Now I have CMSIS compiled (using internal CDT, make didnt work). EHAT however has an include in your user folder which I don&amp;#39;t have. the errors are:
Info&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;: Internal Builder is used for build
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include/ble/ble_services&amp;quot; &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include/sd_common&amp;quot; &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include/ble&amp;quot; &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include/s110&amp;quot; &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include/app_common&amp;quot; &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include/gcc&amp;quot; &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/nrf51_sdk/nrf51822/Include&amp;quot; -I/Users/hoan/I-SYST/swdev/fwdev/include &amp;quot;-IC:\\NRF\\dev_root\\ARM\\Nordic\\nRF51/EHAL/include&amp;quot; -std=gnu99 -c -o &amp;quot;src\\ledmx.o&amp;quot; &amp;quot;..\\..\\..\\..\\..\\src\\ledmx.c&amp;quot; 
..\..\..\..\..\src\ledmx.c:38:21: fatal error: istddef.h: No such file or directory
 #include &amp;quot;istddef.h&amp;quot;
                     ^
compilation terminated.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14881?ContentTypeID=1</link><pubDate>Mon, 20 Oct 2014 17:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a185f42-fa42-4da6-9245-42fb73c6e49a</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;It should be.  What error did you get ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14880?ContentTypeID=1</link><pubDate>Mon, 20 Oct 2014 17:22:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5898fc28-7411-4157-a28b-261e0919d210</guid><dc:creator>AlexDM0</dc:creator><description>&lt;p&gt;Hi Nguyen,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure why but I can&amp;#39;t compile the CMSIS... Is all the code needed for that on the git page?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf51x22 with Keil in C++</title><link>https://devzone.nordicsemi.com/thread/14879?ContentTypeID=1</link><pubDate>Mon, 20 Oct 2014 15:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e903d34-086e-48a0-a31f-5fa05e156fe1</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;if you want to use C++ with Eclipse &amp;amp; GCC, try here &lt;a href="http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html"&gt;embeddedsoftdev.blogspot.ca/.../ehal-nrf51.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>