2006-09-14 01:56 AM
2006-09-13 10:08 PM
Hi!
I wondered how I can compile inline functions with armcc. I triedCode:
inline void whatever();
andCode:
static inline void whatever();
I call the function withCode:
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.2006-09-13 10:19 PM
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.
2006-09-13 10:27 PM
oh, i didnt know that, thanks! Does every compiler handle this so?
2006-09-14 01:56 AM
Yes, they do.
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.