英文:
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)
英文:
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)
答案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.0
与bcc-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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论