代码之家  ›  专栏  ›  技术社区  ›  batuman

错误:变量__use_explation__set,但不用于构建Intel CAffe

  •  0
  • batuman  · 技术社区  · 6 年前

    我正在尝试建立英特尔咖啡馆。 我使用G++5.5.0版。

    我有错误

    src/caffe/layer_factory.cpp:91:8: error: variable ‘use_dilation’ set but not used [-Werror=unused-but-set-variable]
        bool use_dilation = false;
        ^
        src/caffe/layer_factory.cpp: In instantiation of ‘boost::shared_ptr<caffe::Layer > caffe::GetConvolutionLayer(const caffe::LayerParameter&) [with Dtype = double]’:
        src/caffe/layer_factory.cpp:163:1: required from here
        src/caffe/layer_factory.cpp:91:8: error: variable ‘use_dilation’ set but not used [-Werror=unused-but-set-variable]
        cc1plus: all warnings being treated as errors
        Makefile:810: recipe for target '.build_release/src/caffe/layer_factory.o' failed
        make: *** [.build_release/src/caffe/layer_factory.o] Error 1
        make: *** Waiting for unfinished jobs....
    

    可能有什么问题?

    我试图添加 初始化后,使用\u explation=false;。 但还是有错误。

    我怎样才能解决这个问题?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Dmytro Prylipko    6 年前

    警告本身只是轻微的。正如ulug toprak所指出的,这里只是一个未使用的变量。但由于以下原因,您会得到一个错误:

    cc1plus: all warnings being treated as errors
    

    makefile:422中有一行:

    CXX_HARDENING_FLAGS += -fPIC -fno-operator-names -Wformat -Wformat-security -Wall -Werror
    

    这会导致警告被视为错误。刚刚删除 -Werror 旗帜。