Re: [Boost-users] vc 7.1 bug: multiple definitions of symbol with Boost.Test

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
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.

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
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.

On 12/29/05 4:21 AM, "Perepelitsa Roman"
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? 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. 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. -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com
participants (2)
-
Daryle Walker
-
Perepelitsa Roman