Issues about project builds
Brought to you by:
yunwei37
Originally created by: saivian1
src/wasm-bpf.cpp with the code libbpf_set_strict_mode(LIBBPF_STRICT_ALL);LIBBPF_STRICT_ALL is the macro defined in #include. This header file was added in wasm-bpf.cpp.
Originally posted by: try-agaaain
I pulled the latest repository and did not get this error after executing the make command, can you provide the error message output from the terminal?
Originally posted by: saivian1
[ 63%] Building C object CMakeFiles/vmlib.dir/third_party/wasm-micro-runtime/core/iwasm/aot/aot_runtime.c.o
[ 65%] Building C object CMakeFiles/vmlib.dir/third_party/wasm-micro-runtime/core/iwasm/aot/arch/aot_reloc_aarch64.c.o
[ 67%] Linking C static library libvmlib.a
gmake[3]: Leaving directory '/home/saivian1/wasm-bpf/build'
[ 67%] Built target vmlib
gmake[3]: Entering directory '/home/saivian1/wasm-bpf/build'
Scanning dependencies of target wasm-bpf_LIB
gmake[3]: Leaving directory '/home/saivian1/wasm-bpf/build'
gmake[3]: Entering directory '/home/saivian1/wasm-bpf/build'
[ 68%] Building CXX object CMakeFiles/wasm-bpf_LIB.dir/src/wasm-bpf.cpp.o
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp: In function ‘void init_libbpf()’:
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp:24:28: error: ‘LIBBPF_STRICT_ALL’ was not declared in this scope
24 | libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
| ^~~~~~~~~~~~~~~~~
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp:24:5: error: ‘libbpf_set_strict_mode’ was not declared in this scope; did you mean ‘libbpf_set_print’?
24 | libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
| ^~~~~~~~~~~~~~~~~~~~~~
| libbpf_set_print
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp: In function ‘bpf_buffer bpf_buffer__new(bpf_map)’:
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp:83:9: error: ‘bpf_map__set_autocreate’ was not declared in this scope; did you mean ‘bpf_map__set_pin_path’?
83 | bpf_map__set_autocreate(events, false);
| ^~~~~~~~~~~~~~~~~~~~~~~
| bpf_map__set_pin_path
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp: In function ‘int bpf_buffer__open(bpf_buffer, bpf_buffer_sample_fn, void)’:
/home/saivian1/wasm-bpf/src/wasm-bpf.cpp:112:61: error: cannot convert ‘void ()(void, int, void, __u32)’ {aka ‘void ()(void, int, void, unsigned int)’} to ‘const perf_buffer_opts*’
112 | inner = perf_buffer__new(fd, PERF_BUFFER_PAGES, perfbuf_sample_fn,
|
Originally posted by: try-agaaain
The two symbols
libbpf_set_strict_modeandbpf_map__set_autocreateare defined in the./third_party/bpftoolfolder. I guess the problem is that the header file is not correctly added to the search path. Maybe you need to check whether the header file is included in CMakeLists.txt correctly, or whether the correct header file is included in the cpp/h file.