在Mac OS上安装Caffe时出错

时间:2018-06-28 08:50:10

标签: caffe

Scanning dependencies of target caffeproto
[  0%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o
In file included from /Users/cm/caffe/build/include/caffe/proto/caffe.pb.cc:4:
In file included from /Users/cm/caffe/build/include/caffe/proto/caffe.pb.h:25:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:35:
In file included from /usr/local/include/google/protobuf/wire_format_lite_inl.h:43:
/usr/local/include/google/protobuf/message_lite.h:117:3: error: unknown type
       name 'constexpr'
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ^
/usr/local/include/google/protobuf/message_lite.h:117:13: error: expected member
       name or ';' after declaration specifiers
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ~~~~~~~~~ ^

1 个答案:

答案 0 :(得分:0)

我有同样的问题。这是要做什么:
-如果您使用的是cmake,请尝试将-std = c ++ 11添加到C标志:

if(UNIX OR APPLE)

set(CMAKE_CXX_FLAGS“ $ {CMAKE_CXX_FLAGS} -fPIC -Wall -std = c ++ 11”)
endif()

  • 如果使用的是Make文件,请尝试将相同的标志添加到makefile

希望这会有所帮助。

大卫