Building API with Caffe WINDOWS

58 views
Skip to first unread message

klo...@vicomtech.org

unread,
Apr 20, 2017, 7:42:14 AM4/20/17
to Caffe Users

I haved compiled caffe successfully in windows but when I include caffe headers in my project I got compiling errors.

Steps to reproduce

I have the following class structure:

api.h
#include "dl_handler.h"
...

dl_handler.h
#include "classifier.h"
...

classifier.h
#include <caffe/caffe.hpp>
...

When I try to complite it, however, I got the following 2 errors twice:
C:\Source\caffe\scripts\build\include\caffe/proto/caffe.pb.h(2734): error C2059: syntax error: "="
C:\Source\caffe\scripts\build\include\caffe/proto/caffe.pb.h(2735): error C2238: unexpected token before ';'

Which refer to these lines in caffe.pb.h:

static const DimCheckMode STRICT = ParamSpec_DimCheckMode_STRICT;
static const DimCheckMode STRICT = V1LayerParameter_DimCheckMode_STRICT;


I have already tried to add in my classifier.h


#define GLOG_NO_ABBREVIATED_SEVERITIES
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#define NO_STRICT
#include "windows.h"


as explained in #5043, but the errors persist. Does anybody know how to solve this?


Thanks!


System configuration

Operating system: WIndows 10
Compiler: Visual studio 14 2015 Win64
CUDA version (if applicable): v 8.0

I my cmake I have:

find_package(Caffe)
if (Caffe_FOUND)
INCLUDE_DIRECTORIES( ${Caffe_INCLUDE_DIRS} )
MESSAGE("Found!; ${Caffe_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "Caffe libraries not found. Please set Caffe_INCLUDE_DIR.")
endif()

TARGET_LINK_LIBRARIES( prototype
${Caffe_LIBRARIES})

Reply all
Reply to author
Forward
0 new messages