This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Mixing GNU C89 extern inline and C++ inline on Cygwin?
- From: Brian Dessent <brian at dessent dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 14 Aug 2006 15:04:39 -0700
- Subject: Re: Mixing GNU C89 extern inline and C++ inline on Cygwin?
- References: <17632.40775.475239.661398@metro-north.cs.columbia.edu>
- Reply-to: gcc-help at gcc dot gnu dot org
Jonathan Lennox wrote:
> When optimization is turned on, and thus inline functions are actually
> inlined, everything works fine. However, on Cygwin, when functions are not
> inlined, I get link-time errors: the weak symbol emitted for the C++ code
> conflicts with the backup definition. (This problem does not occur on
> ELF-based systems, tested on GNU/Linux (RHEL 4) and Solaris 8.)
>
> Is this a gcc bug?
No, I think it's just a fact of life that PE/COFF has no concept of weak
symbol visibility in the way that ELF does. You may be able to find
more details on this in the binutils mailing list archives, but I think
it's a fundamental restriction of Windows. There might be a different
kind of workaround involving dllexport-type trickery, but I don't know.
Brian