This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C++ support on NRF9160

Hello,

Does nrf9160 support C++? If it does, which version?

I saw a similar question over 2 years ago in which C++ was not recommended (https://devzone.nordicsemi.com/f/nordic-q-a/54056/c-in-nrf9160). I wonder if anything changed and if there is any sample with cpp.

Thanks

Parents
  • Hi,

    Yes, the nRF Connect SDK supports C++. The support has improved over time and currently C++ is also used within the SDK (specifically by the OpenThread and Matter implementations). C++11 is the default configuration but you can change this if you want another C++ dialect (98, 11, 14, 17, 2a, 20, 2b). For instance, if you want to use C++ 17 you use CONFIG_STD_CPP17. Please not that not all C++ features are supported, see C++ Support for Applications.

  • Thank you for the info and link! So Zephyr is the OS running on the 9160 module and DK, and it does offer C++. I saw the C++ sample now.
    One more question: is there any difference between using Segger and VS Code in terms of C++ options? Or it's unrelated to the IDE?

    Thanks

  • In principle there is no difference between using VS Code or west directly, or using Segger Embedded Studio Nordic Edition with NCS. However, with Segger the build process is a bit different and there are some bugs that are only seen when using Segger. Generally I recommend using VS Code or command line unless you are very invested in using Segger.

    Note that when building C++ application that uses the standard library you need some more configurations than what is demonstrated in the C++ Synchronization sample, as described in this post.

Reply
  • In principle there is no difference between using VS Code or west directly, or using Segger Embedded Studio Nordic Edition with NCS. However, with Segger the build process is a bit different and there are some bugs that are only seen when using Segger. Generally I recommend using VS Code or command line unless you are very invested in using Segger.

    Note that when building C++ application that uses the standard library you need some more configurations than what is demonstrated in the C++ Synchronization sample, as described in this post.

Children
No Data
Related