ARM-software / optimized-routines

Optimized implementations of various library functions for ARM architecture processors
Other
582 stars 92 forks source link

linking with cpp code #42

Open tlapik123 opened 2 years ago

tlapik123 commented 2 years ago

I had a problem with linking the library together with cpp code. The error: undefined reference to /* some function */

I resolved it using the solution below. Would it be possible to add this to the repo [include files]? Or is there other solution that I just didn't see?

Possible solution

#ifdef __cplusplus
extern "C" {
#endif

/* header declarations */

#ifdef __cplusplus
}
#endif
nsz-arm commented 2 years ago

i think it makes sense to make the headers c++ compatible, for now you can do it in your c++ code (not tested):

extern "C" {
#include "mathlib.h"
}
tlapik123 commented 2 years ago

i think it makes sense to make the headers c++ compatible, for now you can do it in your c++ code (not tested):

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

Can confirm - this works as-well. TY