I am trying to call an inline function defined in C from C++ code and I am getting an unresolved symbol error. Can I even do this?
In def.h:
#ifdef __cplusplus
extern "C" {
#endif
#include "types.h"
extern inline void foo();
#ifdef __cplusplus
}
#endif /* extern "C" */
In def.c:
inline void foo()
{
some code
}
Elsewhere in c++ code:
void bar()
{
foo();
}
And this is where I get an unresolved symbol error. Is there a way to make this compile? And if so, how will it work? Will the compiler replace the function call in my C++ code by the C definition? Eliminating functional calls is important as this is for an embedded environment.
Thank you.