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

Please can you add extern "C" as appropriate to your header files?

Hi,

Many of us use C++ rather than C (as it is superior in every way). When including many of the Nordic SDK header files it is necessary to wrap them in

extern "C" {
}

to get the proper linkage. Otherwise you get cryptic error messages like "impossible constraint in ‘asm’".

The standard practice to avoid this necessity is to add the extern wrapper to the header code where appropriate like this:

#ifdef __cplusplus
extern "C" {
#endif

// ...

#ifdef __cplusplus
}
#endif

But you haven't done that in any of the headers. Please can you do so?

Related