<?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>VSCode main.c to main.cpp</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80594/vscode-main-c-to-main-cpp</link><description>Hi, 
 We need to know what are the changes we need to follow when we replace main.c with main.cpp in VSCode for nCS 1.7.0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Oct 2021 11:34:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80594/vscode-main-c-to-main-cpp" /><item><title>RE: VSCode main.c to main.cpp</title><link>https://devzone.nordicsemi.com/thread/333905?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 11:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b25979da-a402-4508-ae4f-fa2f54db6665</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Hitesh,&lt;/p&gt;
&lt;p&gt;Thanks for your query.&lt;/p&gt;
&lt;p&gt;You can rename the file from .c to .cpp , set configure (.conf) file as CONFIG_CPLUSPLUS=y and you must include main.cpp instead of main.c in CMakeLists.txt.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here are useful link you can look at- 1.&amp;nbsp;&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/samples/subsys/cpp/cpp.html"&gt;https://docs.zephyrproject.org/latest/samples/subsys/cpp/cpp.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.&amp;nbsp; &amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/samples/subsys/cpp/cpp.html"&gt;https://docs.zephyrproject.org/latest/samples/subsys/cpp/cpp.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>