[serialization] ambiguous symbol if include "binary_iarchive.hpp"

Hi, I meet a compile error of boost::function only when I add this line #include <boost/archive/binary_iarchive.hpp> I'm using VC2005, boost 1.35.0 error message: error C2872: 'function' : ambiguous symbol 1> could be 'e:\libraries\boost_1_35_0\boost\function\function_base.hpp(106) : boost::function' 1> or 'boost::detail::function' 1> or 'e:\libraries\boost_1_35_0\boost\function\function_base.hpp(106) : boost::function' // ======= the code =============================== #include "stdafx.h" #include <boost/function.hpp> using boost::function; #include <boost/archive/binary_iarchive.hpp> //////////////// when add this line, error will happen int _tmain(int argc, _TCHAR* argv[]) { function<void()> fn; return 0; } //================================================== Thanks, Wang Yun

I tried this on my VC 2003 with boost from the trunk and got no problem #include <boost/function.hpp> using boost::function; #include <boost/archive/binary_iarchive.hpp> int main(int argc, char * argv[]) { function<void()> fn; return 0; } Robert Ramey Wang Yun wrote:
Hi,
I meet a compile error of boost::function only when I add this line #include <boost/archive/binary_iarchive.hpp>
I'm using VC2005, boost 1.35.0
error message:
error C2872: 'function' : ambiguous symbol 1> could be 'e:\libraries\boost_1_35_0\boost\function\function_base.hpp(106) : boost::function' 1> or 'boost::detail::function' 1> or 'e:\libraries\boost_1_35_0\boost\function\function_base.hpp(106) : boost::function'
// ======= the code ===============================
#include "stdafx.h"
#include <boost/function.hpp> using boost::function;
#include <boost/archive/binary_iarchive.hpp> //////////////// when add this line, error will happen
int _tmain(int argc, _TCHAR* argv[]) { function<void()> fn;
return 0; }
//==================================================
Thanks, Wang Yun
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

AMDG Robert Ramey wrote:
I tried this on my VC 2003 with boost from the trunk and got no problem
#include <boost/function.hpp>
using boost::function;
#include <boost/archive/binary_iarchive.hpp>
int main(int argc, char * argv[])
{
function<void()> fn;
return 0;
}
Using VC 2005 sp1 it compiles with both 1.34.1 and the trunk but not 1.35.0 In Christ, Steven Watanabe
participants (3)
-
Robert Ramey
-
Steven Watanabe
-
Wang Yun