Building FUSE with g++
Friday, January 27, 2012 g++ -Wall `pkg-config fuse --cflags --libs` hello.c -o hello // in the fuse/example/hello.c Error:
hello.c: At global scope:
hello.c:87: error: expected primary-expression before ‘.’ token
hello.c:88: error: expected primary-expression before ‘.’ token
hello.c:89: error: expected primary-expression before ‘.’ token
hello.c:90: error: expected primary-expression before ‘.’ token
Let's take a look at the offending code:
1: static struct fuse_operations hello_oper = {
2: .getattr = hello_getattr,
3: .readdir = hello_readdir,
4: .open = hello_open,
5: .read = hello_read,
6: };
1: static struct hello_operations : fuse_operations {
2: fms_operations() {
3: getattr = hello_getattr;
4: read = hello_read;
5: ...
6: }
7: } hello_oper_init;
fuse_main not found! Make sure you insert the "#define FUSE_USE_VERSION 26" BEFORE you include <fuse.h>. Permission Denied!?
This one is really weird. The OS user who starts the FUSE program is the only one who can read/write to the files UNLESS you edit /etc/fuse.conf to have the one line: user_allow_other You can read about it at the Fuse wiki. It essentially lets other users read FUSE mounted folders. If you're still getting permission denied, make sure the permissions on /etc/fuse.conf are: -rw-r--r-- 1 root fuse 215 2012-01-26 20:44 /etc/fuse.conf // owned by group fuse, chmod 644! That should work.
FUSE 