码迷,mamicode.com
首页 > 其他好文 > 详细

cocos3 error C2440

时间:2014-12-05 14:07:07      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   os   sp   on   div   log   

>d:\program files (x86)\microsoft visual studio 11.0\vc\include\xrefwrap(431): error C2440: “return”: 无法从“void”转换为“bool” (..\Classes\HelloWorldScene.cpp)
1>          void 类型的表达式不能转换为其他类型
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(239): 参见对正在编译的函数 模板 实例化“_Ret std::_Callable_obj<_Ty>::_ApplyX<_Rx,cocos2d::Touch,cocos2d::Event>(_V0_t &&,_V1_t &&)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Rx=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(239): 参见对正在编译的函数 模板 实例化“_Ret std::_Callable_obj<_Ty>::_ApplyX<_Rx,cocos2d::Touch,cocos2d::Event>(_V0_t &&,_V1_t &&)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Rx=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(239): 编译类 模板 成员函数“bool std::_Func_impl<_Callable,_Alloc,_Rx,_V0_t,_V1_t>::_Do_call(_V0_t &&,_V1_t &&)”时
1>          with
1>          [
1>              _Callable=_MyWrapper,
1>              _Alloc=std::allocator<std::_Func_class<bool,cocos2d::Touch *,cocos2d::Event *>>,
1>              _Rx=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(516): 参见对正在编译的类 模板 实例化“std::_Func_impl<_Callable,_Alloc,_Rx,_V0_t,_V1_t>”的引用
1>          with
1>          [
1>              _Callable=_MyWrapper,
1>              _Alloc=std::allocator<std::_Func_class<bool,cocos2d::Touch *,cocos2d::Event *>>,
1>              _Rx=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(516): 参见对正在编译的函数 模板 实例化“void std::_Func_class<_Ret,_V0_t,_V1_t>::_Do_alloc<_Myimpl,_Ty,_Alloc>(_Fty &&,_Alloc)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Alloc=std::allocator<std::_Func_class<bool,cocos2d::Touch *,cocos2d::Event *>>,
1>              _Fty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(516): 参见对正在编译的函数 模板 实例化“void std::_Func_class<_Ret,_V0_t,_V1_t>::_Do_alloc<_Myimpl,_Ty,_Alloc>(_Fty &&,_Alloc)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Alloc=std::allocator<std::_Func_class<bool,cocos2d::Touch *,cocos2d::Event *>>,
1>              _Fty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(516): 参见对正在编译的函数 模板 实例化“void std::_Func_class<_Ret,_V0_t,_V1_t>::_Reset_alloc<_Ty,std::allocator<std::_Func_class<_Ret,_V0_t,_V1_t>>>(_Fty &&,_Alloc)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Fty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Alloc=std::allocator<std::_Func_class<bool,cocos2d::Touch *,cocos2d::Event *>>
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(516): 参见对正在编译的函数 模板 实例化“void std::_Func_class<_Ret,_V0_t,_V1_t>::_Reset_alloc<_Ty,std::allocator<std::_Func_class<_Ret,_V0_t,_V1_t>>>(_Fty &&,_Alloc)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Fty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Alloc=std::allocator<std::_Func_class<bool,cocos2d::Touch *,cocos2d::Event *>>
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(692): 参见对正在编译的函数 模板 实例化“void std::_Func_class<_Ret,_V0_t,_V1_t>::_Reset<_Ty>(_Fty &&)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Fty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>
1>          ]
1>          d:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(692): 参见对正在编译的函数 模板 实例化“void std::_Func_class<_Ret,_V0_t,_V1_t>::_Reset<_Ty>(_Fty &&)”的引用
1>          with
1>          [
1>              _Ret=bool,
1>              _V0_t=cocos2d::Touch *,
1>              _V1_t=cocos2d::Event *,
1>              _Ty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>,
1>              _Fty=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>
1>          ]
1>          d:\test\classes\helloworldscene.cpp(44): 参见对正在编译的函数 模板 实例化“std::function<_Fty> &std::function<_Fty>::operator =<HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>>(_Fx &&)”的引用
1>          with
1>          [
1>              _Fty=bool (cocos2d::Touch *,cocos2d::Event *),
1>              _Fx=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>
1>          ]
1>          d:\test\classes\helloworldscene.cpp(44): 参见对正在编译的函数 模板 实例化“std::function<_Fty> &std::function<_Fty>::operator =<HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>>(_Fx &&)”的引用
1>          with
1>          [
1>              _Fty=bool (cocos2d::Touch *,cocos2d::Event *),
1>              _Fx=HelloWorld::init::<lambda_47d8d039f668b53728fe566a69062bc8>
1>          ]

 

匿名函数没有写返回值。

cocos3 error C2440

标签:style   blog   io   color   os   sp   on   div   log   

原文地址:http://www.cnblogs.com/yufenghou/p/4146402.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!