caffe - error: variable ‘use_dilation’ set but not used in building intel caffe
问题描述
I am trying to build intel caffe. I use g++ version 5.5.0.
I have error at
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....
What could be wrong?
I tried to add use_dilation = false; after the initialization. But still have error.
How can I fix that?
解决方案
警告本身只是次要的。正如 Ulug Toprak 所指出的,只是有一个未使用的变量。但是你会因为这个得到一个错误:
cc1plus: all warnings being treated as errors
在 Makefile:422 中有这一行:
CXX_HARDENING_FLAGS += -fPIC -fno-operator-names -Wformat -Wformat-security -Wall -Werror
这会导致警告被视为错误。只需删除-Werror
标志。
推荐阅读
- oracle - 如何根据Oracle中另一个表的值生成一个表的选择查询
- java - 找不到eclipse项目帮帮我
- php - 使用 EVO-Snap 的 EVO Snap 支付网关 - PHP HostedPayments 库
- c# - 在 Entity Framework Core 中建立关系
- optimization - 每个维度具有不同步长的 scipy L-BFGS-B 优化器
- visual-c++ - 如何对 UWP 组件中的非导出类进行单元测试 (C++/WinRT)
- spring-integration - Spring Integration Java DSL:如何在 JUnit 中运行集成流程?
- android - 后台执行限制和前台服务被杀死
- c++ - 为什么我的编译器无法识别“Bond() = default;”?
- c# - Leafllet 与 ASP .NET MVC 的集成