I wondered how I can compile inline functions with armcc. I tried
Code:
inline void whatever();
and
Code:
static inline void whatever();
I call the function with
Code:
whatever();
But when i try to compile the project i get an linker error: Undefined symbol whatever (referred from 71x_it.o)... What's wrong. How do I make use of inline wiht armcc? regards, E.
Obviously, an inline function has to be defined in the same compilation unit (source file) where it is called. That's why they are often put into header files.
Think about it. It's the compiler's job to do function inlining. In order to do that, it has to see the functions's definition. The compiler can see only one source file at a time. That's where the limitation comes from.