Opened 5 years ago

Closed 5 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:


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.

Attachments (0)

Change History (5)

comment:1 follow-up: Changed 5 years ago by viboes

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 Changed 5 years ago by viboes

  • Owner changed from anthonyw to viboes
  • Status changed from new to assigned

comment:3 in reply to: ↑ 1 Changed 5 years ago by anonymous

Replying to viboes:

Hi, sorry it should be BOOST_CONSTEXPR_OR_CONST.

That fixes it.

Many thanks for all your work!

comment:4 Changed 5 years ago by viboes

  • Milestone changed from To Be Determined to Boost 1.51.0

Committed in trunk revision 79288.

comment:5 Changed 5 years ago by viboes

  • Resolution set to fixed
  • Status changed from assigned to closed

Committed revision [79373].

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain viboes.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.