This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Makefile Modification for C++ Build

Hello,

I am using nordic sdk and working with C files.

But i would like to work on with C++ files as well.

How will i modify the makefile so that it can build both C and C++ can you show me an example ? Thanks

Parents
  • Hi,

    Here is a makefile that is made for the ble_app_template example for PCA10028:

    Makefile

    You also have to add #extern "C" {} around everything that talks to the C-domain from cpp. Main.c have to be changed to main.cpp. Here is the ble_app_template project with the ledwrapper Torbjørn made:

    ble_app_template_cpp.zip

  • I am trying to get this template to compile using sdk 12.3. Gives me this error arm-none-eabi-gcc.exe: error: /cygdrive/d/src/nRF5_SDK_12.3.0_d7731ad/nRF5_SDK_1 2.3.0_d7731ad/components/libraries/button/app_button.c: No such file or director y Can someone help me out in fixing this?

Reply
  • I am trying to get this template to compile using sdk 12.3. Gives me this error arm-none-eabi-gcc.exe: error: /cygdrive/d/src/nRF5_SDK_12.3.0_d7731ad/nRF5_SDK_1 2.3.0_d7731ad/components/libraries/button/app_button.c: No such file or director y Can someone help me out in fixing this?

Children