Boost logo

Boost Users :

Subject: Re: [Boost-users] 'Multiply defined' errors in Boost 1.38.
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-02-22 11:53:55


Dyer, Nigel wrote:

> Hi Volodya
>
> The two boost libraries that cause problems are boost/test and
> boost/lambda, and if I remove them all is fine in this example.

So, you have a workaround?

>
> The problem only appears with <link>static. If there is no <link>static
> requirement then I get an error message saying that the bio-pch.h.gch is
> not used because BOOST_SYSTEM_DYN_LINK us defined.

Well, you can add <use>/boost/filesystem//boost_filesystem to the requirements
of our pch target so that the PCH is built withe the same defines as the
your executable.

> I assume that this
> means that precompiled headers are incompatible with dynamic link
> builds, although this does not appear to be mentioned.

No, this means that PCH should be built with *exactly* the same compiler
options, including defines.

>
> If I define the exe as below in a static build the precompiled header
> builds with no problems and the code links with no errors. I suspect
> that by not having the pch as a source this means it is not working as a
> pch however
>
> exe nigel
> :
> Lexer/BiobaseLexer.cpp
> Lexer/ArrayLexer.cpp
> #/boost/filesystem//boost_filesystem
> main_nigel.cpp
> :
> <variant>static:<source>bio-pch

There's no such variant as 'static', FWIW. There's <link>static

- Volodya


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