Modify

Ticket #7074 (closed Bugs: fixed)

Opened 22 months ago

Last modified 22 months ago

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

Attachments

Change History

comment:1 follow-up: ↓ 3 Changed 22 months 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 22 months ago by viboes

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

comment:3 in reply to: ↑ 1 Changed 22 months 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 22 months ago by viboes

  • Milestone changed from To Be Determined to Boost 1.51.0

Committed in trunk revision 79288.

comment:5 Changed 22 months ago by viboes

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

Committed revision [79373].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.