Re: C++-compatible definitions of C99-style inline functions

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

 



On Thu, 17 Jan 2013, Solomon Gibbs wrote:

Hello,

I have some C99 code used by C++11 application code. A few inline
functions are declared in the C99 style with code explicitly generated
in the translation unit using the C99 extern inline.

However, when I try to use one of the inline functions in the C++
application, I get errors about multiple definitions at link time. It
seems that g++ is instantiating the inline code that already exists in
the library, despite the extern "C" specifier.

Your issue seems specific to windows. On linux, gcc does instantiate the inline code, but it emits a weak symbol in app.o that is discarded at link time in favor of the strong one in buffer.o.

--
Marc Glisse


[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