如何使用Fuse文件系统进行转换?
我收到此错误:
错误:从
int (*)(const char*, fusion_file_info*)
到int (*)(const char*, int)
的无效转换
错误:当我这样做
static struct fuse_operations vkfs_opers;
...
vkfs_opers.open = vkfs_open;
但声明了函数 as
static int vkfs_open (const char *path, struct fuse_file_info *fi)
并在结构 fuse_operations
中声明为
int (*open) (const char *, struct fuse_file_info *);
I'm getting this error:
Error: invalid conversion from
int (*)(const char*, fuse_file_info*)
toint (*)(const char*, int)
when i do
static struct fuse_operations vkfs_opers;
...
vkfs_opers.open = vkfs_open;
but function is declarated as
static int vkfs_open (const char *path, struct fuse_file_info *fi)
and in structure fuse_operations
it declarated as
int (*open) (const char *, struct fuse_file_info *);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在包含
之前尝试 #define FUSE_USE_VERSION 26。解决方案的来源是此讨论。
Try #define FUSE_USE_VERSION 26 before including
<fuse.h>
.Source of solution is this discussion.
你所做的似乎是正确的,所以我不知道你为什么会收到这个错误。我的第一个猜测是它是其他错误的副作用。这是编译时遇到的唯一错误,还是还有其他错误?
What you've done seems correct, so I don't know why you are getting that error. My first guess would be that its a side effect of some other error. Is that the only error you get when you compile, or are there others?
如果您有 makefile,请在 CFLAGS 中添加适当的定义 -DFUSE_USE_VERSION=26
所以你想要这样的行: CFLAGS += -DFUSE_USE_VERSION=26
if you have a makefile add to your CFLAGS the appropriate define -DFUSE_USE_VERSION=26
so you want a line like this: CFLAGS += -DFUSE_USE_VERSION=26