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]

 



Lennyk wrote:

How can I expose an inline function WITHOUT implementing it in the header file?


What do you mean by "expose"?

If you want any caller of the function to be able to use it inline, you need to implement it in a header file (not necessarily the same header file where you declare it).

If you want callers from only the same cpp file where the function is defined to have it inline, but callers from other cpp files to use a non inline version, I'm pretty sure that behavior is possible in GCC, subject to choosing the right command line switches. But I forget the details.

I think you want callers from other cpp files to have the function inline without seeing the definition. GCC doesn't do that. (It would require a totally different interface between compiler and linker and would require a lot of extra support in the linker).



[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