libraries\include\boost-1_61\boost/regex/v4/perl_matcher.hpp(362): error C2292: 'boost::re_detail_106100::perl_matcher<const char *,std::allocator<boost::sub_match<const char *>>,boost::regex_traits<c

这个问题在Windows上基于CMake编译Caffe-SSD的GPU版时出现。

网上找到的博客贴出的解决办法是删掉regex和rv相关代码,甚至不编译detection_output_layer.cu。。。这和“干掉提出问题者”有什么区别呢?

我的解决办法:

在caffe windows依赖包中修改libraries_v120_x64_py27_1.1.0\libraries\include\boost-1_61\boost\regex\v4\perl_matcher.hpp文件:
#include <boost/regex/v4/iterator_category.hpp>后,添加:

#ifdef _MSC_VER
#pragma pointers_to_members( full_generality, single_inheritance )
#endif

解释一下:

MSDN上对于pointer_to_memmers的解释 提到,其语法为:

#pragma pointers_to_members( pointer-declaration, [most-general-representation] )

并且,most-general-representation的默认值为best_case
通过google检索#pragma pointers_to_members发现,这个宏应该是cl.exe特有的,gcc的话我没有找到,llvm的话似乎有人提issue要去实现。

猜你喜欢

转载自www.cnblogs.com/zjutzz/p/10694023.html