Hello,
I am using Segger Embedded Studio (SES) to develop with the nRF5340 BLE chip. From what I've read, the nRF Connect SDK and Zephyr OS is not tailored for use with C++, but it is possible to use it by going to "Project->Configure nRF Connect SDK Project" and checking the box that says "C++ support for the application". I've tried doing this with the sample projects in ncs/nrf/samples/bluetooth, like the peripheral_gatt_dm sample. However when I change the main.c file to main.cpp, and change my CMakeLists.txt file to include main.cpp instead of main.c, it seems that SES is not aware of the existence of the file. There is no main.cpp in the Project Explorer pane.
I've also tried an alternative method by right-clicking on "Project app/libapp.a" in the Project Explorer pane and attempting to add main.cpp to the project by selecting "Add Existing File to CMakeLists.txt". However, when using this method I am only given the option of adding .c files, not .cpp files.
Finally, I found that I can get main.cpp to show up in the Project Explorer pane by manually dragging the file from my Windows File Explorer into the Project Explorer pane of SES. But there is no option to "Build and Debug" or "Build And Run" the project. How do I get SES to use the main.cpp file (and corresponding main() function), as specified in the CMakeLists.txt file?
Thanks,
Keron