<?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>fault with calling int main( )</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80556/fault-with-calling-int-main</link><description>Hello, 
 I modified a sample app &amp;quot;blinky&amp;quot; on segger, to include main.cpp instead of main.c Then when I built, I got a compile time error stating in main.cpp &amp;quot;void main(void)&amp;quot; should be changed to &amp;quot;int main( )&amp;quot; I changed and it compiled successfully. Now</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Oct 2021 12:29:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80556/fault-with-calling-int-main" /><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334605?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 12:29:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e92109df-25d2-4150-89a6-92c8499bff3d</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Thank you so much&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;, This helps..!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334590?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 11:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:606dc160-2a81-49fa-bdb7-31f1a1e7e95e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;If you add a new folder that you need to include from, then you need to do this. This is only the case for include paths you add yourself, though (so your folders with your files in them).&lt;/p&gt;
&lt;p&gt;This is not the case if you for instance add a library that already exists in the nRF Connect SDK. For any library/driver/etc. that is part of the nRF Connect SDK this is done for you, so you only need to enable it in your prj.conf. Finding it can be difficult, but here I suggest you refer to a relevant sample for what you want to do. You can also search the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index-all.html"&gt;list of all configuration options&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334559?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 10:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e5bba74-0a72-4462-8615-08d40e0a435b</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Thank you, I worked out with something similar:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)

#file(GLOB app_files temp/*)
#target_sources(app PRIVATE ${app_files})
target_include_directories(app PUBLIC temp)
add_subdirectory(temp)

file(GLOB app_sources src/*)
target_sources(app PRIVATE ${app_sources})

zephyr_library_include_directories(.)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, I defined a new CMakeLists.txt inside newly defined folder &amp;quot;temp&amp;quot; as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

target_sources(app PRIVATE ex_class.cpp)

&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And included in the project directory &amp;quot;&lt;span&gt;CMakeLists.txt&amp;quot; as:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;add_subdirectory(temp)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So my question is when to do this..? That is, to add &amp;amp; use&amp;nbsp;&lt;/span&gt;&lt;span&gt;add_subdirectory&lt;/span&gt;&lt;span&gt;(temp) in the project directory &amp;quot;CMakeLists.txt&amp;quot;.?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334551?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 10:46:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38234153-d73c-422e-a59d-38b0e8b8a7c6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As long as the headers and source files are all in the same folder there is no need to add the folders to the include path. But if not, you need to add them. Here I have modified your CMakeLists.txt to add both folders to the include path:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)

# Add source directories
file(GLOB app_files temp/*)
target_sources(app PRIVATE ${app_files})

file(GLOB app_sources src/*)
target_sources(app PRIVATE ${app_sources})

# Add inlcude directories
target_include_directories(app PRIVATE include temp)
target_include_directories(app PRIVATE include src)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334518?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 08:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ab64d8c-8939-4135-9fbc-4a6a491df8f2</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Have attached my sample workspace&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Sample.7z"&gt;devzone.nordicsemi.com/.../Sample.7z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am using the same workspace that you suggested&amp;nbsp;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/80556/fault-with-calling-int-main/333867#333867"]Please see this sample: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_cpp_5F00_additional_5F00_source_5F00_files.zip"&gt;hello_world_cpp_additional_source_files.zip&lt;/a&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Only change I have made is defined a new folder &amp;quot;temp&amp;quot; within and added &amp;quot;ex_Class.h&amp;quot; and &amp;quot;ex_Class.cpp&amp;quot;.&lt;br /&gt;Then I am trying to&amp;nbsp;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;ex_class.h&amp;quot; in &amp;quot;main.cpp&amp;quot;, when I am getting the error stating:&lt;br /&gt;cannot open source file &amp;quot;ex_class.h&amp;quot;&lt;br /&gt;&lt;br /&gt;Kindly help me solve this error.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334475?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 06:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0a75e7e-cdea-4051-bf98-4f2e02754080</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Will create a new thread for that,&amp;nbsp;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/80556/fault-with-calling-int-main/333867#333867"]Please see this sample: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_cpp_5F00_additional_5F00_source_5F00_files.zip"&gt;hello_world_cpp_additional_source_files.zip&lt;/a&gt;.[/quote]
&lt;p&gt;In this project you referred, I need to move&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&amp;quot;my_class.h&amp;quot; &amp;amp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;quot;my_class.cpp&amp;quot; into a separate folder known as &amp;quot;Sample\app_files&amp;quot;.&lt;br /&gt;&lt;br /&gt;I did and made the following changes to CMakeLists.txt:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)

file(GLOB app_sources src/*)
target_sources(app PRIVATE ${app_sources})

file(GLOB app_files app_files/*)
target_sources(app PRIVATE ${app_files})

file(GLOB app_includes app_files/)
target_include_directories(app PRIVATE include ${app_includes})

&lt;/pre&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Now the project is throwing build errors as:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1634538711237v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;Kindly help me on how to accommodate the files&amp;#39; relocation changes in CMakeLists.txt to build successfully.&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334472?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 06:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daa9635b-9ae5-49fe-bf82-7910eaaa7980</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Ubaid,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The clock control is available&amp;nbsp;without the need to do any adjustments to prj.conf or similar. Simply add include statements&amp;nbsp;and call the&amp;nbsp;API functions you need. I suggest you refer to a relevant &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/master/tests/drivers/clock_control"&gt;clock control tests&lt;/a&gt; to see an example.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please make a new thread for new questions&amp;nbsp;like this in the future.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334449?ContentTypeID=1</link><pubDate>Sun, 17 Oct 2021 10:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9d6b196-87a1-409a-b583-1bbe1e1b276f</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Thank you the info,&lt;br /&gt;Moving ahead, Request you to guide me on what are all the changes I will&amp;nbsp;have to make,&lt;br /&gt;So as to call the file:&amp;nbsp;&lt;br /&gt;nCS\v1.7.0\zephyr\include\drivers\clock_control.h (#include clock_control.h)&lt;br /&gt;&lt;br /&gt;In &amp;quot;my_class.h&amp;quot; file that&amp;nbsp;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/80556/fault-with-calling-int-main/333867#333867"]Please see this sample: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_cpp_5F00_additional_5F00_source_5F00_files.zip"&gt;hello_world_cpp_additional_source_files.zip&lt;/a&gt;. It works well with NCS 1.7.0 and SES, and demonstrates C++ including adding a second file.[/quote]
&lt;p&gt;you helped me with the other day.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ubaid&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334176?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:08:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2920e20-baf2-4b2b-bf4d-af60dbca94bd</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Ubaid_M"]Thank you so much, This I was able to work successfully work with on VSCode.[/quote]
&lt;p&gt;Good to hear.&lt;/p&gt;
[quote user="Ubaid_M"]There are some errors, yet the project is building fine.[/quote]
&lt;p&gt;The error you posted in text and from the screenshot is the same. I have not been able to reproduce myself, but this looks like it is just from the intelligence in VS Code, and does not have any impact on the building of the project itself. I suggest you ignore it. Alternatively, look into the C_Cpp settings in your VS Code configuration (perhaps &lt;a href="https://github.com/Microsoft/vscode-cpptools/issues/3279"&gt;this thread&lt;/a&gt; has something useful).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/334039?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 07:26:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76389884-2ae6-448d-901a-dcb80e99f2f6</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Thank you so much, This I was able to work successfully work with on VSCode.&lt;br /&gt;&lt;br /&gt;Strangely though, as in below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1634196188635v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;There are some errors, yet the project is building fine. If you see in the snapshot,&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;zephyr.h&amp;gt; is highlighted in red&lt;br /&gt;&lt;br /&gt;And also there is an error:&lt;strong&gt;&amp;nbsp;{&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;resource&amp;quot;: &amp;quot;/d:/sample_app/Sample/src/main.cpp&amp;quot;,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;owner&amp;quot;: &amp;quot;C/C++&amp;quot;,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;code&amp;quot;: &amp;quot;1696&amp;quot;,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;severity&amp;quot;: 8,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;message&amp;quot;: &amp;quot;cannot open source file \&amp;quot;stddef.h\&amp;quot; (dependency of \&amp;quot;zephyr.h\&amp;quot;)&amp;quot;,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;source&amp;quot;: &amp;quot;C/C++&amp;quot;,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;startLineNumber&amp;quot;: 7,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;startColumn&amp;quot;: 1,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;endLineNumber&amp;quot;: 7,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; &amp;quot;endColumn&amp;quot;: 20&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How can I solve this issue..?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333867?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 09:15:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6806f853-b9a8-4674-9d1b-717993d0917a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;There is no indication here of what is wrong. I have updated the hello world sample to also add a second file with a dummy class. Please test that. If you experience problems use the Toolchain manager and open Segger Embedded Studio from there so that you know it works.&lt;/p&gt;
&lt;p&gt;Please see this sample: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_cpp_5F00_additional_5F00_source_5F00_files.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_cpp_5F00_additional_5F00_source_5F00_files.zip&lt;/a&gt;. It works well with NCS 1.7.0 and SES, and demonstrates C++ including adding a second file.&lt;/p&gt;
&lt;p&gt;As you see from this screenshot it works well debugging in SES:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/debug_5F00_in_5F00_ses.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;And with a UART terminal you should see this output (board name will depend on the target board you are using to test):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Hello World! nrf52840dk_nrf52840
Number is: 5
Number is now: 10&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333853?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 08:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78316a6d-6586-4797-aa5e-e0aecbc7506d</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;I am facing compile time issues with the inclusion of&amp;nbsp;nCS files in main.cpp:&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1634034103787v1.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/80556/fault-with-calling-int-main/333834#333834"] see you only included the SES build folder, but not the folder below, which is where the relevant parts are (your source files and the CMakeLists.txt and prj.conf)[/quote]
&lt;p&gt;I couldn&amp;#39;t understand this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333834?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 07:28:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a33dc87-0f01-47c8-a103-9b79d86154a7</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see you only included the SES build folder, but not the folder below, which is where the relevant parts are (your source files and the CMakeLists.txt and prj.conf). Regardless, the way to add an additional C file is to either simply add a new&amp;nbsp;&lt;code&gt;target_sources&lt;/code&gt; like this (snippet from CMakeLists.txt):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;target_sources(app PRIVATE src/main.cpp)
target_sources(app PRIVATE src/other_source_file.cpp)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or you can do it like this so that app files within your src folder is added automatically:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;file(GLOB app_sources src/*)
target_sources(app PRIVATE ${app_sources})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regarding &lt;em&gt;creating&lt;/em&gt; the file that is just a text file, so you can use your favorite editor or any other way you prefer.&lt;/p&gt;
&lt;p&gt;Noe that after doing this you must open the project in SES again using File -&amp;gt; Open nRF Connect SDK Project... so that CMake runs again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333827?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 06:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f74b5c0b-0905-43fb-80d3-82924750e3c9</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello &lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/80556/fault-with-calling-int-main/333703#333703"]You should not do this within Segger Embedded studio. Make the new file outside of it, and add it in CMakeLists.txt. Then the Segger embedded studio project is generated for you correctly.[/quote]
&lt;p&gt;How do I make a new file outside of it and add it in CMakeLists.txt.?&lt;br /&gt;&lt;br /&gt;Can you kindly suggest.!&lt;br /&gt;&lt;br /&gt;Have attached my hello_world sample project for your reference with main.cpp&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7041.CPP_5F00_Test.7z"&gt;devzone.nordicsemi.com/.../7041.CPP_5F00_Test.7z&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333703?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 10:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad27c20e-35c4-476c-b6eb-34802408d696</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Ubaid_M"]Further, i read that build.emProject modification is necessary when we define a new file, so I copied the fields under main.c as is into main.cpp with additional definition of &amp;quot;cpp_only_additional_options&amp;quot;.[/quote]
&lt;p&gt;You should not do this within Segger Embedded studio. Make the new file outside of it, and add it in CMakeLists.txt. Then the Segger embedded studio project is generated for you correctly. (Generally, it is not a good idea to make changes within SES anyway as that does changes in the build folder, and you want to get your project correctly generated every time you open it or after you have cleaned it.)&lt;/p&gt;
&lt;p&gt;I am still not able to reproduce the issue you are seeing. But using nRF Connect SDK 1.7.0 and the hello_world sample as you referred to it, it works and I am able to debug with a minimal change as demonstrated by this sample: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_cpp.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_cpp.zip&lt;/a&gt;. Can you try that on your end? Open it in Segger embedded studio, build and debug. Does it work as expected?&lt;/p&gt;
&lt;p&gt;As a side note, unless you are committed to using SES with your development, you may want to look at the &lt;a href="https://nordicplayground.github.io/vscode-nrf-connect/"&gt;nRF Connect for VS Code extension&lt;/a&gt;. That has some advantages over SES when used with the nRF Connect SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333697?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 10:28:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07eadabe-0f62-4c9b-b03b-7f5e21e7d472</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;I am trying to work it out,&amp;nbsp;&lt;br /&gt;By starting with a simplest hello_world sample nCS app,&lt;br /&gt;&lt;br /&gt;I copied contents of main.c into main.cpp, then made changes in CMakeLists.txt and built, I am getting this error:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1634034103787v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1634034133977v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;Here is&amp;nbsp; my CMakeLists.txt:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)
#src/main.c
target_sources(app PRIVATE D:/CPP_Test/cpp_files/main.cpp)
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Further, i read that build.emProject modification is necessary when we define a new file, so I copied the fields under main.c as is into main.cpp with additional definition of &amp;quot;cpp_only_additional_options&amp;quot;.&lt;br /&gt;&lt;br /&gt;Main.c had fields as:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;      &amp;lt;file file_name=&amp;quot;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/samples/hello_world/src/main.c&amp;quot;&amp;gt;
        &amp;lt;configuration
          Name=&amp;quot;Common&amp;quot;
          build_dependency_file_name=&amp;quot;$(ProjectDir)/CMakeFiles\app.dir\src\main.c.obj.d&amp;quot;
          build_exclude_from_build=&amp;quot;Yes&amp;quot;
          build_object_file_name=&amp;quot;CMakeFiles/app.dir/src/main.c.obj&amp;quot;
          c_only_additional_options=&amp;quot;-DBUILD_VERSION=v2.6.99-ncs1;-DKERNEL;-DNRF52833_XXAA;-DUSE_PARTITION_MANAGER=0;-D_FORTIFY_SOURCE=2;-D__LINUX_ERRNO_EXTENSIONS__;-D__PROGRAM_START;-D__ZEPHYR__=1;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;-Izephyr/include/generated;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.;-Os;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-ffreestanding;-fno-common;-g;-gdwarf-4;-fdiagnostics-color=always;-mcpu=cortex-m4;-mthumb;-mabi=aapcs;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h;-Wall;-Wformat;-Wformat-security;-Wno-format-zero-length;-Wno-main;-Wno-pointer-sign;-Wpointer-arith;-Wexpansion-to-defined;-Wno-address-of-packed-member;-Wno-unused-but-set-variable;-Werror=implicit-int;-fno-asynchronous-unwind-tables;-fno-pie;-fno-pic;-fno-strict-overflow;-fno-reorder-functions;-fno-defer-pop;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/samples/hello_world=CMAKE_SOURCE_DIR;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr=ZEPHYR_BASE;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0=WEST_TOPDIR;-ffunction-sections;-fdata-sections;-specs=nano.specs;-std=c99&amp;quot;
          c_preprocessor_definitions=&amp;quot;BUILD_VERSION=v2.6.99-ncs1;KERNEL;NRF52833_XXAA;USE_PARTITION_MANAGER=0;_FORTIFY_SOURCE=2;__LINUX_ERRNO_EXTENSIONS__;__PROGRAM_START;__ZEPHYR__=1;BUILD_VERSION=v2.6.99-ncs1;KERNEL;NRF52833_XXAA;USE_PARTITION_MANAGER=0;_FORTIFY_SOURCE=2;__LINUX_ERRNO_EXTENSIONS__;__PROGRAM_START;__ZEPHYR__=1&amp;quot;
          c_system_include_directories=&amp;quot;&amp;quot;
          c_user_include_directories=&amp;quot;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;zephyr/include/generated;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;zephyr/include/generated;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.&amp;quot;
          code_completion_options=&amp;quot;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h&amp;quot; /&amp;gt;
      &amp;lt;/file&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For Main.cpp,&amp;nbsp;added below makefile instructions just below Main.c instructions&amp;nbsp;as follows:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;      &amp;lt;file file_name=&amp;quot;D:/CPP_Test/cpp_files/main.cpp&amp;quot;&amp;gt;
        &amp;lt;configuration
          Name=&amp;quot;Common&amp;quot;
          c_only_additional_options=&amp;quot;-DBUILD_VERSION=v2.6.99-ncs1;-DKERNEL;-DNRF52833_XXAA;-DUSE_PARTITION_MANAGER=0;-D_FORTIFY_SOURCE=2;-D__LINUX_ERRNO_EXTENSIONS__;-D__PROGRAM_START;-D__ZEPHYR__=1;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;-Izephyr/include/generated;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.;-Os;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-ffreestanding;-fno-common;-g;-gdwarf-4;-fdiagnostics-color=always;-mcpu=cortex-m4;-mthumb;-mabi=aapcs;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h;-Wall;-Wformat;-Wformat-security;-Wno-format-zero-length;-Wno-main;-Wno-pointer-sign;-Wpointer-arith;-Wexpansion-to-defined;-Wno-address-of-packed-member;-Wno-unused-but-set-variable;-Werror=implicit-int;-fno-asynchronous-unwind-tables;-fno-pie;-fno-pic;-fno-strict-overflow;-fno-reorder-functions;-fno-defer-pop;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr=ZEPHYR_BASE;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0=WEST_TOPDIR;-ffunction-sections;-fdata-sections;-specs=nano.specs;-std=c99&amp;quot;
          c_preprocessor_definitions=&amp;quot;BUILD_VERSION=v2.6.99-ncs1;KERNEL;NRF52833_XXAA;USE_PARTITION_MANAGER=0;_FORTIFY_SOURCE=2;__LINUX_ERRNO_EXTENSIONS__;__PROGRAM_START;__ZEPHYR__=1;BUILD_VERSION=v2.6.99-ncs1;KERNEL;NRF52833_XXAA;USE_PARTITION_MANAGER=0;_FORTIFY_SOURCE=2;__LINUX_ERRNO_EXTENSIONS__;__PROGRAM_START;__ZEPHYR__=1&amp;quot;
          c_system_include_directories=&amp;quot;&amp;quot;
          c_user_include_directories=&amp;quot;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;D$(Zephyr_PATH);zephyr/include/generated;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;zephyr/include/generated;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.&amp;quot;
          code_completion_options=&amp;quot;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h&amp;quot; /&amp;gt;
          cpp_only_additional_options=&amp;quot;-DBUILD_VERSION=v2.6.99-ncs1;-DKERNEL;-DNRF52833_XXAA;-DUSE_PARTITION_MANAGER=0;-D_FORTIFY_SOURCE=2;-D__LINUX_ERRNO_EXTENSIONS__;-D__PROGRAM_START;-D__ZEPHYR__=1;-ID$(Zephyr_PATH);-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include;-Izephyr/include/generated;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/soc/arm/nordic_nrf/nrf52;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/lib/libc/newlib/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/nrf/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/drivers/include;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/hal/nordic/nrfx/mdk;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/hal_nordic/nrfx/.;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/SEGGER;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/modules/debug/segger/Config;-ID:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/modules/segger/.;-Os;-imacros;D:/CPP_Test/zephyr/include/generated/autoconf.h;-ffreestanding;-fno-common;-g;-gdwarf-4;-fdiagnostics-color=always;-mcpu=cortex-m4;-mthumb;-mabi=aapcs;-imacros;D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h;-Wall;-Wformat;-Wformat-security;-Wno-format-zero-length;-Wno-main;-Wno-pointer-sign;-Wpointer-arith;-Wexpansion-to-defined;-Wno-address-of-packed-member;-Wno-unused-but-set-variable;-Werror=implicit-int;-fno-asynchronous-unwind-tables;-fno-pie;-fno-pic;-fno-strict-overflow;-fno-reorder-functions;-fno-defer-pop;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0/zephyr=ZEPHYR_BASE;-fmacro-prefix-map=D:/Nordic_App/Nordic_SDK/nCS/v1.7.0=WEST_TOPDIR;-ffunction-sections;-fdata-sections;-specs=nano.specs;-std=c99&amp;quot;
      &amp;lt;/file&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kindly help me resolve those.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333672?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 09:01:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e24796-e034-4ea8-8ccb-2631a8806899</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. I am not able to explain that, as it looks like the basic is in place. However, I do not know the details of your configuration (NCS version, toolchain version, etc). Can you test the sample I referred to from nRF Connect SDK 1.7.0 and using the toolchain manager so that you know the toolchain is good? That should work and does on my side.&lt;/p&gt;
&lt;p&gt;Update: I just noticed that you add both main.c and main.cpp in your CMakeLIsts.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;target_sources(app PRIVATE D:/CPP_Test/cpp_files/main.cpp src/main.c)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;you should have got a linker error if main is defined in both so it is a bit odd, but a smoking gun. (also, you probably use relative paths to make your project portable, but that is a different topic).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333659?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 08:18:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3e2bff5-6807-4abc-bd60-e574cfcf61a8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. I am not able to explain that, as it looks like the basic is in place. However, I do not know the details of your configuration (NCS version, toolchain version, etc). Can you test the sample I referred to from nRF Connect SDK 1.7.0 and using the toolchain manager so that you know the toolchain is good? That should work and does on my side.&lt;/p&gt;
&lt;p&gt;Update: I just noticed that you add both main.c and main.cpp in your CMakeLIsts.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;target_sources(app PRIVATE D:/CPP_Test/cpp_files/main.cpp src/main.c)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;you should have got a linker error if main is defined in both so it is a bit odd, but a smoking gun.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333642?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 07:42:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6df01ac5-92ec-4a63-aa20-a6db0f9a0b49</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/eith"&gt;Einar&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Yes i have set the CPLUS_PLUS feature, I have also set below:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_CPLUSPLUS=y&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_HEAP_MEM_POOL_SIZE=16384&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_NEWLIB_LIBC=y&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_LIB_CPLUSPLUS=y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But, my problem is that execution is not entering &amp;quot;int main( )&amp;quot; in main.cpp&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fault with calling int main( )</title><link>https://devzone.nordicsemi.com/thread/333635?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 07:36:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e1f0dc2-16b6-402a-9eed-bf426929a681</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you set &lt;code&gt;CONFIG_CPLUSPLUS=y&lt;/code&gt; in your prj.conf? I recommend you take a look at the &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.0/zephyr/samples/subsys/cpp/cpp_synchronization/README.html"&gt;C++ Synchronization sample&lt;/a&gt;&amp;nbsp;(which is the only C++ sample for now).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>