[Rcpp-devel] gcc 10 error: symbol `fun' is already defined

Kevin Ushey kevinushey at gmail.com
Sun Feb 9 03:35:28 CET 2020

Here's an example program that fails to compile with gcc-10 for me:


So I think we can conclude this is a gcc-10 bug. It also fails with
the contracts branch of gcc on godbolt (although with a different


But gcc trunk seems okay.


On Sat, Feb 8, 2020 at 5:20 PM Dirk Eddelbuettel <edd at debian.org> wrote:
> On 8 February 2020 at 16:59, Kevin Ushey wrote:
> | It seems like a bug in gcc 10 to me. IIUC, static local variables in
> | inline functions should still have internal linkage, and so name
> | collisions like this should not occur.
> |
> | I can work around this by making sure that 'fun' is given different
> | names in the RcppEigen stubs; e.g. fun1 and fun2 and so on. The fact
> | that this actually works makes me think it might be a gcc bug.
> Thanks for looking, and checking. My (uneducated) guess and hunch went the
> same way.
> Dirk
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list