falco/userspace/engine/rule_reader.cpp:31:21: error: ‘class YAML::Node’ has no member named ‘Mark’

源码编译Falco时报错

/home/jack/code/falco/falco/userspace/engine/rule_reader.cpp: In function ‘rule_loader::context yaml_get_context(const string&, const std::vector<YAML::Node>&, std::vector<YAML::Node>::iterator, YAML::iterator)’:
/home/jack/code/falco/falco/userspace/engine/rule_reader.cpp:31:21: error: ‘class YAML::Node’ has no member named ‘Mark’
  size_t from = item.Mark().pos - 2;
                     ^~~~
/home/jack/code/falco/falco/userspace/engine/rule_reader.cpp:36:14: error: ‘struct YAML::detail::iterator_value’ has no member named ‘Mark’
   to = node->Mark().pos - 2;
              ^~~~
/home/jack/code/falco/falco/userspace/engine/rule_reader.cpp:41:13: error: ‘class YAML::Node’ has no member named ‘Mark’
   to = doc->Mark().pos - 4;
             ^~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-class-memaccess’
userspace/engine/CMakeFiles/falco_engine.dir/build.make:215: recipe for target 'userspace/engine/CMakeFiles/falco_engine.dir/rule_reader.cpp.o' failed
make[3]: *** [userspace/engine/CMakeFiles/falco_engine.dir/rule_reader.cpp.o] Error 1
CMakeFiles/Makefile2:1373: recipe for target 'userspace/engine/CMakeFiles/falco_engine.dir/all' failed
make[2]: *** [userspace/engine/CMakeFiles/falco_engine.dir/all] Error 2
CMakeFiles/Makefile2:1412: recipe for target 'userspace/falco/CMakeFiles/falco.dir/rule' failed
make[1]: *** [userspace/falco/CMakeFiles/falco.dir/rule] Error 2
Makefile:631: recipe for target 'falco' failed
make: *** [falco] Error 2

已经执行了如下语句:

apt install libssl-dev libc-ares-dev libprotobuf-dev protobuf-compiler libjq-dev libgrpc++-dev protobuf-compiler-grpc libcurl4-openssl-dev libyaml-cpp-dev

还是报错,已经安装了libyaml-cpp-dev。没有效果,

https://falco.org/docs/getting-started/source/官网上有这么一句:

If you are on Ubuntu 18.04, instead of cmake .. do cmake -DUSE_BUNDLED_DEPS=ON ...

本人的系统刚好是Ubuntu 18.04.2 LTS \n \l

所以执行

 cmake -DUSE_BUNDLED_DEPS=ON .. 

即可。

它会下载源码进行编译安装:

-- Downloading...
   dst='/home/jack/code/falco/falco/build/yamlcpp-prefix/src/yaml-cpp-0.6.2.tar.gz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.2.tar.gz'
-- [download 100% complete]

 

后面还是会报错:

/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:56:37: error: variable or field ‘gpr_log_dispatcher_func’ declared void
 static void gpr_log_dispatcher_func(gpr_log_func_args* args)
                                     ^~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:56:37: error: ‘gpr_log_func_args’ was not declared in this scope
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:56:37: note: suggested alternative: ‘gpr_atm_full_cas’
 static void gpr_log_dispatcher_func(gpr_log_func_args* args)
                                     ^~~~~~~~~~~~~~~~~
                                     gpr_atm_full_cas
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:56:56: error: ‘args’ was not declared in this scope
 static void gpr_log_dispatcher_func(gpr_log_func_args* args)
                                                        ^~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:56:56: note: suggested alternative: ‘abs’
 static void gpr_log_dispatcher_func(gpr_log_func_args* args)
                                                        ^~~~
                                                        abs
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp: In member function ‘void falco::grpc::server::init(std::__cxx11::string, int, std::__cxx11::string, std::__cxx11::string, std::__cxx11::string, std::__cxx11::string)’:
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:150:25: error: ‘GPR_LOG_SEVERITY_ERROR’ was not declared in this scope
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR);
                         ^~~~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:150:25: note: suggested alternative: ‘CURLE_WRITE_ERROR’
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR);
                         ^~~~~~~~~~~~~~~~~~~~~~
                         CURLE_WRITE_ERROR
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:150:3: error: ‘gpr_set_log_verbosity’ was not declared in this scope
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR);
   ^~~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:150:3: note: suggested alternative: ‘gpr_ref_non_zero’
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR);
   ^~~~~~~~~~~~~~~~~~~~~
   gpr_ref_non_zero
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:153:25: error: ‘GPR_LOG_SEVERITY_DEBUG’ was not declared in this scope
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
                         ^~~~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:153:25: note: suggested alternative: ‘CURL_VERSION_DEBUG’
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
                         ^~~~~~~~~~~~~~~~~~~~~~
                         CURL_VERSION_DEBUG
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:158:25: error: ‘GPR_LOG_SEVERITY_INFO’ was not declared in this scope
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_INFO);
                         ^~~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:158:25: note: suggested alternative: ‘GPR_EVENT_INIT’
   gpr_set_log_verbosity(GPR_LOG_SEVERITY_INFO);
                         ^~~~~~~~~~~~~~~~~~~~~
                         GPR_EVENT_INIT
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:161:2: error: ‘gpr_log_verbosity_init’ was not declared in this scope
  gpr_log_verbosity_init();
  ^~~~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:161:2: note: suggested alternative: ‘gpr_event_init’
  gpr_log_verbosity_init();
  ^~~~~~~~~~~~~~~~~~~~~~
  gpr_event_init
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:162:23: error: ‘gpr_log_dispatcher_func’ was not declared in this scope
  gpr_set_log_function(gpr_log_dispatcher_func);
                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:162:2: error: ‘gpr_set_log_function’ was not declared in this scope
  gpr_set_log_function(gpr_log_dispatcher_func);
  ^~~~~~~~~~~~~~~~~~~~
/home/jack/code/falco/falco/userspace/falco/grpc_server.cpp:162:2: note: suggested alternative: ‘curl_lock_function’
  gpr_set_log_function(gpr_log_dispatcher_func);
  ^~~~~~~~~~~~~~~~~~~~
  curl_lock_function
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-class-memaccess’
userspace/falco/CMakeFiles/falco.dir/build.make:628: recipe for target 'userspace/falco/CMakeFiles/falco.dir/grpc_server.cpp.o' failed
make[3]: *** [userspace/falco/CMakeFiles/falco.dir/grpc_server.cpp.o] Error 1
CMakeFiles/Makefile2:1435: recipe for target 'userspace/falco/CMakeFiles/falco.dir/all' failed
make[2]: *** [userspace/falco/CMakeFiles/falco.dir/all] Error 2
CMakeFiles/Makefile2:1442: recipe for target 'userspace/falco/CMakeFiles/falco.dir/rule' failed
make[1]: *** [userspace/falco/CMakeFiles/falco.dir/rule] Error 2
Makefile:644: recipe for target 'falco' failed
make: *** [falco] Error 2

重新下载编译一次,就好了。

Ubuntu 20.04.4 LTS  也报错误:


/usr/bin/ld: ../../libsinsp/libsinsp.a(k8s_handler.cpp.o): undefined reference to symbol 'SSL_get_verify_result@@OPENSSL_1_1_0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [userspace/falco/CMakeFiles/falco.dir/build.make:770: userspace/falco/falco] Error 1
make[2]: *** [CMakeFiles/Makefile2:1524: userspace/falco/CMakeFiles/falco.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1531: userspace/falco/CMakeFiles/falco.dir/rule] Error 2
make: *** [Makefile:641: falco] Error 2

解决方式同上。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值