[iterator] link errors for zip_iterator in MSVC 8

Hi, When I link multiple files that have included zip_iterator.hpp I get the following link error in MSVC 8.0. ...found 16 targets... ...updating 3 targets... msvc.link ..\bin\examples\msvc-8.0\release\test.exe ..\bin\examples\msvc-8.0\release\test.rsp test2.obj : error LNK2005: "bool __cdecl boost::detail::tuple_impl_specific::tuple_equal(struct boost::tuples::null_type,struct boost::tuples::null_type)" (?tuple_equal@tuple_impl_specific@detail@boost@@YA_NUnull_type@tuples@3@0@Z) already defined in test1.obj ..\bin\examples\msvc-8.0\release\test.exe : fatal error LNK1169: one or more multiply defined symbols found call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" > nul link /NOLOGO /subsystem:console /out:"..\bin\examples\msvc-8.0\release\test.exe" /INCREMENTAL:NO @"..\bin\examples\msvc-8.0\release\test.rsp" ...failed msvc.link ..\bin\examples\msvc-8.0\release\test.exe ..\bin\examples\msvc-8.0\release\test.rsp... ...removing ..\bin\examples\msvc-8.0\release\test.rsp ...failed updating 2 targets... ...updated 1 target... I have attached the two files I am compiling and my Jamfile. Thanks, Chris

You could change zip_iterator.hpp:319 to //bool tuple_equal(tuples::null_type, tuples::null_type) //{ return true; } template<typename Tuple1, typename Tuple2> bool tuple_equal( Tuple1 const& t1, Tuple2 const& t2 ) { return t1==t2; } This assumes that the comparison operator for tuples works on your compiler as described by the comment in zip_iterator.hpp. This is what I did. Otherwise you could change it to (untested): template<typename Tuple1, typename Tuple2> bool tuple_equal( Tuple1 const& t1, Tuple2 const& t2 ) { return t1.get_head() == t2.get_head() && tuple_equal(t1.get_tail(), t2.get_tail()); } template<> bool tuple_equal<tuples::null_type, tuples::null_type>( const tuples::null_type&, const tuples::null_type&) { return true; } _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Hi, I won't be able to compile on VC 8 'til tomorrow but as far as I can see Kevin Sopp wrote:
You could change zip_iterator.hpp:319 to
This needs to be inline bool tuple_equal(tuples::null_type, tuples::null_type) { return true; } and that's it. I.e. it needs to be inline to avoid the multiple definition issues. I'll fix this as soon as I get to vc8. HTH Thomas -- Thomas Witt witt@acm.org

Thomas Witt wrote:
Hi,
I won't be able to compile on VC 8 'til tomorrow but as far as I can see
Kevin Sopp wrote:
You could change zip_iterator.hpp:319 to
This needs to be
inline bool tuple_equal(tuples::null_type, tuples::null_type) { return true; }
Fixed in CVS now, thanks for the report. Thomas -- Thomas Witt witt@acm.org
participants (3)
-
Chris Weed
-
Kevin Sopp
-
Thomas Witt