undefined reference when calling inline function

前端 未结 1 1639
醉话见心
醉话见心 2020-11-27 04:48

I am getting a really odd error from GCC 4.8.1 with inline functions.

I have two near-identical inline functions defined in header files (debug.h and

相关标签:
1条回答
  • 2020-11-27 05:36

    According to the manual, passing -std=gnu11 enables C99 instead of GNU inline semantics.

    This means inline, static inline and extern inline all behave differently. In particular, inline expects an external definition in a separate translation unit (which you can provide without duplicating the definition - see this answer).

    0 讨论(0)
提交回复
热议问题