libraries\include\boost-1_61\boost/regex/v4/perl_matcher.hpp(362): error C2292: 'boost::re_detail_106100::perl_matcher >,boost::regex_traits


這個問題在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要去實現。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM