Re: [Boost-users] vc 7.1 bug: multiple definitions of symbol with Boost.Test
On 12/29/05 4:21 AM, "Perepelitsa Roman"
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
On Mon, 2006-01-02 at 04:48 -0500, Daryle Walker wrote: 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@biostat.ucsf.edu Dept of Epidemiology and Biostatistics fax: (415) 514-8150 University of California, San Francisco San Francisco, CA 94107-1739 hm: (415) 550-1062
participants (1)
-
Ross Boylan