iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.37k stars 3.86k forks source link

error: unknown type name ‘GElf_Versym’; did you mean ‘GElf_Verdef’? #4911

Open NobinPegasus opened 7 months ago

NobinPegasus commented 7 months ago

While trying to build the BCC I face the following error:

/home/pegasus/Documents/eBPF/learning-ebpf/bcc/src/cc/libbpf/src/elf.c:160:9: error: unknown type name ‘GElf_Versym’; did you mean ‘GElf_Verdef’?
  160 |         GElf_Versym versym;
      |         ^~~~~~~~~~~
      |         GElf_Verdef

How can I fix it?

yanruotian commented 5 months ago

Hello I meet the same error. May I have your suggestion if you have fixed it? Thank you.

NobinPegasus commented 5 months ago

Hello, you can look here. It was a mismatch in versions of libelf-dev, llvm, clang. If I recall it right. So what you have to do is do a complete fresh installation of all LLVM related packages. And be sure that the versions all match. I would suggest building from source. And make sure to add the build to the path.

yanruotian commented 5 months ago

Yes you are right. I reinstalled all related packages and the error disappeared. Thank you very much.