I got some compiler/linker errors and i don't know what is the correct method to proceed. I'm in this situation:
- a.h: in this file is defined a function declared as "inline", for example: inline void foo1();
- b.h: in this file is defined a function declared as "inline" that calls foo1(): inline void foo2();
- main.c: there are some functions calls of both foo1 and foo2().
Now, if i declare foo1 and foo2 in a.h and b.h as extern inline void i got the following error:
prj/src/b.o: In function
foo1': (.text+0x0): multiple definition of
foo1' prj/src/main.o:(.text+0x0): first defined here make: * [kernel] Error 1
What is the way which allow to compile and link without errors/warning in the situation i described?
static inline
? – Shimmy#include
a file, all of its contents become part of the current translation unit. – Interrogate