This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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++ development using nRF51 SDK on Keil

It seems that many people use GCC toolchain (with "high" setup effort) for utilizing SDK in C++ development. It should however be possible also on Keil with less setup effort, I hope.

It is obvious that the SDK libraries must be included as below:

extern "C" {
#include "sdklib.h"
}

What are the other steps & issues to take care in order to configure the Keil for C++ development? Can some expert please direct me to the right documentation or share his own experience?

I am aware that similar questions have been asked before: devzone.nordicsemi.com/.../ devzone.nordicsemi.com/.../ devzone.nordicsemi.com/.../ However I could not find any clear answer.

Update: log.txt of the blinky_example from below.

Parents
  • Hi

    I tried this myself, and was able to compile C++ code simply by opening the options for all my source files and defining the files as 'C++ source code' files.

    I modified the blinky example in the SDK and added a small LedWrapper class to make LED management a bit more intuitive:

    blinky_example_cpp.zip

    Feel free to have a look at the example and see if you can get it to run.

    Regards Torbjørn

Reply
  • Hi

    I tried this myself, and was able to compile C++ code simply by opening the options for all my source files and defining the files as 'C++ source code' files.

    I modified the blinky example in the SDK and added a small LedWrapper class to make LED management a bit more intuitive:

    blinky_example_cpp.zip

    Feel free to have a look at the example and see if you can get it to run.

    Regards Torbjørn

Children
Related