<?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>Compiling C code as C++ fails</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105441/compiling-c-code-as-c-fails</link><description>Hi, I have a functional C source code for reading a Grid-Eye thermal Sensor on a nRF52840-DK. 
 Because I want to use a C++ library, I want to compile my source code as C++ too, but that fails with the following error. 
 I suspected an issue with the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Nov 2023 14:12:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105441/compiling-c-code-as-c-fails" /><item><title>RE: Compiling C code as C++ fails</title><link>https://devzone.nordicsemi.com/thread/454490?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 14:12:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54e08d53-a676-4a4f-9f90-4db0e1a9c0e7</guid><dc:creator>rwahidi</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;I noticed that my CMakeLists.txt contained a line&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;FILE(GLOB app_sources src/*.c)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I just needed to change it to&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;FILE(GLOB app_sources src/*.cpp)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiling C code as C++ fails</title><link>https://devzone.nordicsemi.com/thread/454402?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 10:45:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:350d1ea4-0e2d-48d7-8c77-5e732eb3fd91</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Not tried it myself, but there is some documentation in zephyr on it that may help:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/develop/languages/cpp/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/develop/languages/cpp/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Searching through the zephyr repositories I can find some .cpp files, so you may look at those projects also if you haven&amp;#39;t already.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>