Opened 8 years ago

Closed 8 years ago

#10386 closed Bugs (fixed)

MSVC link error in asymmetric_coroutine.hpp: symbol already defined

Reported by: Christian Maaser <runningwithscythes@…> Owned by: olli
Milestone: To Be Determined Component: coroutine
Version: Boost 1.56.0 Severity: Problem
Keywords: Cc:

Description

Using MSVC2013 I get a link error when using coroutines through ASIO from multiple compilation units, saying that the constructor "push_coroutine< void >::push_coroutine( coroutine_fn fn, attributes const& attrs)" is already defined in another .obj file.

In fact this method (among several others in the same file) are implementations of fully specialized template methods, which are no longer templates, and thus either need to be defined as inline, or moved into a .cpp file.

Attachments (1)

boost-1_56_0-coroutine_inline_msvc12.patch (2.2 KB ) - added by Christian Maaser <runningwithscythes@…> 8 years ago.
fix for MSVC

Download all attachments as: .zip

Change History (4)

by Christian Maaser <runningwithscythes@…>, 8 years ago

fix for MSVC

comment:1 by Christian Maaser <runningwithscythes@…>, 8 years ago

I attached a simple fix which solves the issue for us (marking the methods in question as inline). The patch is incomplete as it only considers the MSVC code branches. In theory the issue should also affect other compilers, but I don't have time/access to another compiler right now to double check.

comment:2 by MBendiksen@…, 8 years ago

We also had this problem in MSVC. Gcc compiled it with no error though. Adding inline fixes it.

comment:3 by olli, 8 years ago

Resolution: fixed
Status: newclosed

should be fixed in branch develop

Note: See TracTickets for help on using tickets.