caffe配置matlab接口,make matcaffe时出如下问题,求解

MEX matlab/+caffe/private/caffe_.cpp
使用 'g++' 编译。
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp: 在函数‘void delete_solver(int, mxArray**, int, const mxArray**)’中:
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:208:3: 警告: lambda expressions only available with -std=c++11 or -std=gnu++11 [默认启用]
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:208:4: 错误: 对‘remove_if(std::vector<boost::shared_ptr<caffe::Solver<float> > >::iterator, std::vector<boost::shared_ptr<caffe::Solver<float> > >::iterator, delete_solver(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Solver<float> >&)>)’的调用没有匹配的函数
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:208:4: 附注: 备选是:
In file included from /usr/include/c++/4.7/algorithm:63:0,
                 from ./include/caffe/blob.hpp:4,
                 from ./include/caffe/caffe.hpp:7,
                 from /home/liu/caffe/matlab/+caffe/private/caffe_.cpp:18:
/usr/include/c++/4.7/bits/stl_algo.h:1166:5: 附注: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:208:4: 错误: ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’的模板实参使用了局部类型‘delete_solver(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Solver<float> >&)>’
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:208:4: 错误:   试图实例化‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp: 在函数‘void delete_net(int, mxArray**, int, const mxArray**)’中:
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:293:3: 警告: lambda expressions only available with -std=c++11 or -std=gnu++11 [默认启用]
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:293:4: 错误: 对‘remove_if(std::vector<boost::shared_ptr<caffe::Net<float> > >::iterator, std::vector<boost::shared_ptr<caffe::Net<float> > >::iterator, delete_net(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Net<float> >&)>)’的调用没有匹配的函数
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:293:4: 附注: 备选是:
In file included from /usr/include/c++/4.7/algorithm:63:0,
                 from ./include/caffe/blob.hpp:4,
                 from ./include/caffe/caffe.hpp:7,
                 from /home/liu/caffe/matlab/+caffe/private/caffe_.cpp:18:
/usr/include/c++/4.7/bits/stl_algo.h:1166:5: 附注: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:293:4: 错误: ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’的模板实参使用了局部类型‘delete_net(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Net<float> >&)>’
/home/liu/caffe/matlab/+caffe/private/caffe_.cpp:293:4: 错误:   试图实例化‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’

make: *** [matlab/+caffe/private/caffe_.mexa64] 错误 255
已邀请:

王贵军

赞同来自: 刘备他die Sammy_哚

在Makefile.config添加CXXFLAGS += -std=c++11  再编译下就好了

航天小飞羽

赞同来自:

你好,我也遇到了这个问题,请问解决了吗?

heroxx2011

赞同来自:

你好,我也遇到了这个问题,能不能详细解答一下?楼主好人呢

要回复问题请先登录注册