Ben Bacarisse said:
No it doesn't. Putting extern on a normal (non-inline) function
definition has no effect at all.
You suggested solution removed the key element. The OP wants an
inline definition.
And names like this are reserved for use by the implementation (sad,
but true). A better pattern is:
#define H_EXTERN
You do if you want it to be inline, but one should (in general) use
static:
static inline void f() { ... }
The OP's extern inline definition acts as a declaration so the
implementation expects to find a definition of this name with external
linkage -- hence the error message. The OP may want the function to
available in this way (as a identifier with external linkage). In
that case they simply have to provide a non-inline definition like
they would for any such function.
I think very possibly, the OP was trying for 'extern inline', which, it is
worth noting, occurs many places in certain GCC-specific headers...
however, in my compiler, it was reasonable to just ignore them, as they were
creating compiler difficulties...
'static inline' is probably better, but then one may find that certain
compilers (such as MSVC), do not correctly handle the inline keyword (MSVC
apparently expects parens, like "inline(...)" or similar...).
actually, MSVC has several annoyances:
they apparently "deprecate" most of the standard C library (you can use it,
but the compiler complains endlessly);
various standard C features (and especially C99 features) are absent;
....
but, as is, MSVC does have one advantage over GCC:
its current Win64 support is better.
(GCC now has Win64 support, but it is not very good as of yet, so I await a
time when it is improved...).
actually, as is, I am using MSVC and some GCC related tools at the same
time...