|
Boost Users : |
Subject: Re: [Boost-users] [Exception] Duplicate symbol error when using errinfo_api_function in static library
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2013-10-02 19:20:46
On 2 Oct 2013 at 14:48, Emil Dotchevski wrote:
> > Then I have a main.cpp which creates an instance of ClassA and ClassB and
> > links to the library which contains ClassA.o and ClassB.o. When I compile
> > the main.cpp I get the linker error duplicate symbol for the
> > errinfo_api_function object in ClassA.o and ClassB.o. If I remove the
> > visibility=hidden flag, it links without problems. I am not an expert on
> > the compiler flags, but I saw that many libraries use the visibility=hidden
> > flag so I think it would be good, if my lib could also use it.
>
> Honestly I have no idea why this would happen. Anyone?
Throwable types must *always* be marked with attribute visibility
default. I assume this has been done correctly, but if it hasn't that
might help explain the problem. See my doc on the issue at
http://gcc.gnu.org/wiki/Visibility.
Note that throwable types, if with virtual function tables, may
consist of more symbols than otherwise expected.
Niall
-- Currently unemployed and looking for work. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net