Hi guys,
I know that there is no official support for C++ on NordicSemi side, but I just wonder if it would be possible to work with C++ in Segger IDE. I'm trying to integrate optiga IC in my project and started with this example in nRF5_SDK_v3.0. I renamed main.c to main.cpp and compiled it. When I compile I get a missing '}' error.
expected ‘}’ at end of input
I am trying to track down the error. What I did:
- I commented out all function defs, and removed all code in main.cpp. Still the same error
- I put a closing '}' after "nrf_crypto.h" in main.cpp, and the error clears.
#include <stdbool.h> #include <stdint.h> #include <string.h> #include "sdk_common.h" #include "nrf_assert.h" #include "app_error.h" #include "nrf_log.h" #include "nrf_log_ctrl.h" #include "nrf_log_default_backends.h" #include "nrf_crypto.h" } // THIS FIXES #include "nrf_crypto_ecc.h" #include "nrf_crypto_error.h" #include "nrf_crypto_ecdsa.h"
- I tried to go deep and got stuck at "nrf_crypto_eddsa_backend.h" because of dependencies for other libraries. I believe there is a problem with
#ifdef __cplusplus extern "C" { #endif
definitions without closing brace, but I couldn't point it.
I appreciate if you can help me with that. Is there any static analyzer or any other tool that I can use for the purpose?
Best regards,
Vedat