Opened 10 years ago

Closed 10 years ago

#7074 closed Bugs (fixed)

[thread] Multiply defined symbol boost::allocator_arg

Reported by: anonymous Owned by: viboes
Milestone: Boost 1.51.0 Component: thread
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

I'm updating from boost 1_49 to 1_50, a project that uses pre-compiled headers and MSVC 2010. I find I'm getting:

shared.lib(stdafx.obj) : error LNK2005: "struct boost::container::allocator_arg_t boost::allocator_arg" (?allocator_arg@boost@@3Uallocator_arg_t@container@1@A) already defined in stdafx.obj}}}

and consequently:

fatal error LNK1169: one or more multiply defined symbols found

I'm wondering if perhaps the declaration of allocator_arg in thread/detail/memory.hpp should be:

BOOST_STATIC_CONSTEXPR allocator_arg_t allocator_arg = {};

P.S. I feel I'm really sticking my neck out commenting on your code, but it's the only thing that makes sense to me.

Change History (5)

comment:1 by viboes, 10 years ago

Hi, sorry it should be BOOST_CONSTEXPR_OR_CONST.

Please could you try with

BOOST_CONSTEXPR_OR_CONST allocator_arg_t allocator_arg = {};

I will commit it if it solves the issue.

comment:2 by viboes, 10 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

in reply to:  1 comment:3 by anonymous, 10 years ago

Replying to viboes:

Hi, sorry it should be BOOST_CONSTEXPR_OR_CONST.

That fixes it.

Many thanks for all your work!

comment:4 by viboes, 10 years ago

Milestone: To Be DeterminedBoost 1.51.0

Committed in trunk revision 79288.

comment:5 by viboes, 10 years ago

Resolution: fixed
Status: assignedclosed

Committed revision [79373].

Note: See TracTickets for help on using tickets.