命名空间std和boost

时间:2014-11-21 09:53:12

标签: c++ visual-c++ boost

我的项目编译没有任何问题。我在其中一个cpp文件中添加了两行:

#include <boost/log/trivial.hpp>
using namespace std;

并且遇到了与xxresult单位相关的大量错误:

Error   14  error C2825: '_Fty': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error   15  error C2903: 'result' : symbol is neither a class template nor a function template  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error   16  error C2039: 'result' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error   17  error C2143: syntax error : missing ';' before '<'  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error   18  error C2039: 'type' : is not a member of '`global namespace''   C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error   19  error C2238: unexpected token(s) preceding ';'  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error   20  error C2039: '_Type' : is not a member of 'std::tr1::_Result_type2<__formal,_Fty,_Arg0,_Arg1>'  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error   21  error C2146: syntax error : missing ';' before identifier '_Type'   C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error   22  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error   23  error C2602: 'std::tr1::_Result_of2<_Fty,_Farg0,_Farg1>::_Type' is not a member of a base class of 'std::tr1::_Result_of2<_Fty,_Farg0,_Farg1>'  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error   24  error C2868: 'std::tr1::_Result_of2<_Fty,_Farg0,_Farg1>::_Type' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error   25  error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::tr1::_Bind_fty<_Fty,_Ret,_BindN>' (or there is no acceptable conversion) C:\Projektai\fbSrv_2010\serv.cpp    70

如何将boost与std相关以及如何开始解决此类错误?

0 个答案:

没有答案