Boost logo

Boost Users :

From: Ross Boylan (ross_at_[hidden])
Date: 2006-01-02 18:13:18


On Mon, 2006-01-02 at 04:48 -0500, Daryle Walker wrote:
> On 12/29/05 4:21 AM, "Perepelitsa Roman" <romka_at_[hidden]> wrote:
>
> > Sorry, I forgot to mention you have to enable precompiler headers to
> > reproduce the problem. Project Settings -> C/C++ -> Precompiled
> > Headers -> Automatically Generate.
> [TRUNCATE]
>
> Is the header pre-compile option just for VC 7.1, or is it also for (Apple
> special) GCC 3.3?
As I wrote, I didn't request PCH, and I'm not even sure gcc 3.3 supports
them.

> Looking at the code from a few posts ago, complaining
> about the GCC problem, I don't think you can use the pre-compiled header.
> The auto-testing system requires BOOST_AUTO_TEST_MAIN to be #defined in
> exactly one source file, which disqualifies it from being in a common
> header.

True, but it's not the BOOST_AUTO_TEST_MAIN that's causing the problem,
or that's being included in more than one file.

> Worse, that also means that other headers that pay attention to
> that macro can't be in a common header, otherwise the One Definition Rule
> would be broken.
If you have two translation units with an anonymous namespace, they may
appear to be defining the same thing twice. But the C++ standard says
it is not the same thing, since each anonymous namespace is distinct.
So the definitions occur in different namespaces.

Compiler writers seem to be having trouble getting the correct semantics
in this case.

-- 
Ross Boylan                                      wk:  (415) 514-8146
185 Berry St #5700                               ross_at_[hidden]
Dept of Epidemiology and Biostatistics           fax: (415) 514-8150
University of California, San Francisco
San Francisco, CA 94107-1739                     hm:  (415) 550-1062

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