Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2007-07-17 00:15:38


Change

#define BOOST_TEST_SINGLETON_INST( inst ) \
namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst,
_t)::instance(); }

to

#define BOOST_TEST_SINGLETON_INST( inst ) \
namespace { static BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst,
_t)::instance(); }

in trivial_singleton.hpp

Gennadiy

"Christian Henning" <chhenning_at_[hidden]> wrote in message
news:949801310707160728u427058f7l3bf9fd704433af22_at_mail.gmail.com...
> Hi Gennadiy, were you able to find a solution for my problem? I would
> really need a fix, here. Let me know if there is anything I can help
> you out with. My solution right now is to put all my tests into one
> file which is not a good one.
>
> Thanks,
> Christian
>
> On 7/11/07, Christian Henning <chhenning_at_[hidden]> wrote:
>> Hi Gennadiy,
>>
>> This fix only solved one of the LNK2005s. The following error is still
>> appearing:
>>
>> error LNK2005: "class unit_test_log_t::boost::unit_test_log_t &
>> boost::unit_test::`anonymous namespace'::unit_test_log"
>> (?unit_test_log@?A0x7aa5c0d5_at_unit_test_at_boost@@3AAVunit_test_log_t_at_23@A)
>> already defined in database_test.obj
>>
>> Does this fix only applies to MSVC 7.1 only?
>>
>> Thanks,
>> Christian
>>
>>
>> On 7/10/07, Gennadiy Rozental <gennadiy.rozental_at_[hidden]> wrote:
>> > I've seen this error mentioned
>> >
>> > Try changing
>> >
>> > namespace { bool dummy_cond = false; }
>> >
>> > to
>> >
>> > namespace { static bool dummy_cond = false; }
>> >
>> > in test_tools.hpp
>> >
>> > Gennadiy
>> >
>> > "Christian Henning" <chhenning_at_[hidden]> wrote in message
>> > news:949801310707091519w3f187714o3d212031fb31da7d_at_mail.gmail.com...
>> > > Hi there, I'm using boost 1.34 on MSVC 7.1. For whatever reason I
>> > > cannot eliminate various linker errors. I have defined my
>> > > BOOST_AUTO_TEST_CASEs in several .cpp files and this seems to create
>> > > multiple definition of various symbols. The errors look as the
>> > > following:
>> > >
>> > > string_table_test.obj : error LNK2005: "bool
>> > > boost::test_tools::`anonymous namespace'::dummy_cond"
>> > > (?dummy_cond@?A0x7aa5c0d5_at_test_tools_at_boost@@3_NA) already defined in
>> > > ORM_test.obj
>> > > string_table_test.obj : error LNK2005: "class
>> > > unit_test_log_t::boost::unit_test_log_t &
>> > > boost::unit_test::`anonymous
>> > > namespace'::unit_test_log"
>> > > (?unit_test_log@?A0x7aa5c0d5_at_unit_test_at_boost@@3AAVunit_test_log_t_at_23@A)
>> > > already defined in ORM_test.obj
>> > >
>> > > Did anyone had to deal which such messages before?
>> > >
>> > > Thanks ahead,
>> > > Christian
>> >
>> >
>> >
>> > _______________________________________________
>> > Boost-users mailing list
>> > Boost-users_at_[hidden]
>> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
>> >
>>


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