Boost logo

Boost :

From: Eelis van der Weegen (gmane_at_[hidden])
Date: 2005-03-19 08:30:17


I've attached two (tiny) files: a.cpp and b.cpp . They compile fine, but
attempting to link them causes the following error:

b.o(.text+0x0):b.cpp: multiple definition of
`boost::foreach_detail_::cheap_copy(...)'
a.o(.text+0x0):a.cpp: first defined here

I'm using gcc 3.4.2 with boost 1.32 and foreach.hpp revision 1.29 from the sandbox.

Making the non-template cheap_copy() in foreach.hpp at line 322 inline solves
the problem.

Regards,

Eelis


#include <boost/foreach.hpp>
int main () {}


#include <boost/foreach.hpp>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk