Re: undefined reference to... when calling an inline function in a shared library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"John (Eljay) Love-Jensen" <eljay@xxxxxxxxx> writes:

>> How can I expose an inline function WITHOUT implementing it in the
>> header file?
>
> You can't.

Technically, you can, by using "extern inline".  But I agree that
putting the inline function in a header file is normally what you want.

The "inline" keyword is C++ does not, as many people assume, direct the
compiler to inline the function.  What it actually does is change the
linkage of the function.  C++ has three kinds of linkage for functions:
extern, static, and inline.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux