c++ 调用caffe caffe.pb.h错误修正

记录一下

从这个链接编译的caffe

https://blog.csdn.net/xingchenbingbuyu/article/details/72765612

使用

#include "caffe\caffe.hpp"

caffe.pb.h 报错 
caffe.pb.h(2958): error C2059: 语法错误:“常量”

打开错误处,查看代码:
static const DimCheckMode STRICT =
    V1LayerParameter_DimCheckMode_STRICT;

鼠标放上去,提示#define STRICT 1
转到定义, 有2处,一处boost的,一处windows kits 8.1的

打开代码,看到如下代码:

#ifndef NO_STRICT
#ifndef STRICT
#define STRICT 1
#endif
#endif

明显的,命名冲突了,添加预定义就好了,加入NO_STRICT到预处理器,编译,通过

扫描二维码关注公众号,回复: 2954643 查看本文章

猜你喜欢

转载自blog.csdn.net/ybn187/article/details/81298068