Boost logo

Boost Users :

From: Perepelitsa Roman (romka_at_[hidden])
Date: 2005-12-29 04:21:31


Sorry, I forgot to mention you have to enable precompiler headers to
reproduce the problem. Project Settings -> C/C++ -> Precompiled
Headers -> Automatically Generate.

====================

>> I had the same problem with vc 7.1.

> Strange. I never had problems like this with vc7.1

It's very easy to reproduce the problem. Create project with two
source files (e.g. a.cpp and b.cpp) both with the same content:
-- begin
#include <boost/test/floating_point_comparison.hpp>
-- end

When you try to compile you get two errors:
b.obj : error LNK2005: "struct
check_is_small_t::boost::check_is_small_t
boost::test_tools::`anonymous namespace'::check_is_small"
(?check_is_small@?A0xa003c394_at_test_tools_at_boost@@3Ucheck_is_small_t_at_23@A)
already defined in a.obj

b.obj : error LNK2005: "struct
check_is_close_t::boost::check_is_close_t
boost::test_tools::`anonymous namespace'::check_is_close"
(?check_is_close@?A0xa003c394_at_test_tools_at_boost@@3Ucheck_is_close_t_at_23@A)
already defined in a.obj

boost version 1.33.1.

>> If you add 'static' to all
>> variables definitions in anonymous namespaces it works fine.

> But anonimous namespace should do the trick itself!

Agree. Seems like compiler bug to me.

Roman.


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