在调用(_C2func_bcc_func_load)时参数不足。

huangapple go评论118阅读模式
英文:

not enough arguments in call to (_C2func_bcc_func_load)

问题

我在编译Go时遇到了一个错误 not enough arguments in call to (_C2func_bcc_func_load)

使用的Go版本是:go version go1.19.1

如何解决这个错误?如果有人能帮忙,将不胜感激。

错误信息:

github.com/iovisor/gobpf/bcc
/home/jeremy/go/pkg/mod/github.com/iovisor/gobpf@v0.2.0/bcc/module.go:230:132: not enough arguments in call to (_C2func_bcc_func_load)
	have (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, nil)
	want (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, *_Ctype_char, _Ctype_int)

在调用(_C2func_bcc_func_load)时参数不足。

英文:

I am getting an error not enough arguments in call to (_C2func_bcc_func_load)
when compiling Go.

Go Version used: go version go1.19.1

How can I resolve this error? Would appreciate if anyone could help.

Error Message:

github.com/iovisor/gobpf/bcc
/home/jeremy/go/pkg/mod/github.com/iovisor/gobpf@v0.2.0/bcc/module.go:230:132: not enough arguments in call to (_C2func_bcc_func_load)
	have (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, nil)
	want (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, *_Ctype_char, _Ctype_int)

在调用(_C2func_bcc_func_load)时参数不足。

答案1

得分: 1

我使用了最新的与bcc-0.25.0兼容的最近提交:

$ go list -m github.com/iovisor/gobpf@master
github.com/iovisor/gobpf v0.2.1-0.20221005153822-16120a1bf4d4

然后在你的go.mod文件中使用:

require github.com/iovisor/gobpf v0.2.1-0.20221005153822-16120a1bf4d4
英文:

I used latest recent commit which is compatible with bcc-0.25.0:

$ go list -m github.com/iovisor/gobpf@master
github.com/iovisor/gobpf v0.2.1-0.20221005153822-16120a1bf4d4

Then in your go.mod, use:

require github.com/iovisor/gobpf v0.2.1-0.20221005153822-16120a1bf4d4

答案2

得分: 0

似乎你的依赖库 github.com/iovisor 出现了问题。尝试查看他们的 GitHub 页面,看看是否有任何问题,或者执行 go get -u 这样的命令来更新你的项目依赖到最新版本(可能已经发布了一些新版本并修复了问题)。版本也可能在你的 go.mod 文件中受到限制,所以你可能需要在那里进行更改。

英文:

It seems that your dependency library github.com/iovisor was broken. Try to check out their github to see if there are any issues, or just do something like go get -u to update your project dependencies to the latest versions (probably some new version have been already released and the problem is fixed). The version can also be restricted in your go.mod file, so you may want to change it there.

答案3

得分: 0

gobpf@v0.2.0bcc-0.25.0不兼容,但与bcc-0.24.0兼容。

我检出了所需版本的代码:

git clone --branch v0.24.0 https://github.com/iovisor/bcc.git

然后按照从源代码构建的说明进行操作:

mkdir bcc/build; cd bcc/build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 .. # 构建python3绑定
pushd src/python/
make
sudo make install
popd

此问题有更多信息。12天前合并了一个潜在修复的PR-它将在下一个gobpf版本中可用。

英文:

gobpf@v0.2.0 is not compatible with bcc-0.25.0, but it works with bcc-0.24.0.

I checked out the code at the desired version:

git clone --branch v0.24.0 https://github.com/iovisor/bcc.git

Then I followed the instructions to build it from source:

mkdir bcc/build; cd bcc/build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 .. # build python3 binding
pushd src/python/
make
sudo make install
popd

This issue has more information. There was a PR merged 12 days ago with a potential fix - it will be available in the next release of gobpf.

huangapple
  • 本文由 发表于 2022年9月14日 17:36:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/73714654.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定