Pregunta

I am using a java program. It automatically creates log files in a directory, but I am doing that myself a different way with tee. I cannot find an easy way to disable the logs, so I am resorting to using nullfs.

I cloned it with

git clone https://github.com/xrgtn/nullfs.git

and I ran

make nul1fs

as instructed. It terminates within a second, with the following output:

cc   "-lfuse"  nul1fs.c   -o nul1fs
nul1fs.c:13:18: fatal error: fuse.h: No such file or directory
compilation terminated.
make: *** [nul1fs] Error 1

I tried apt-get source fuse and copying fuse.h into the nullfs directory, but nothing changed. I have FUSE installed. I'm running Debian wheezy x86_64.

¿Fue útil?

Solución

You need the development package of FUSE, which contains the fuse.h you're missing. Do a apt-get install libfuse-dev and it should work.

Copying the header file in the source directory did not work, because in nul1fs.c you'll notice that fuse.h is included with angle brackets. This means, the header file will be searched in the system-wide include paths. That usually means /usr/include.


Note that you then may run into this error:

$ make nul1fs
cc   "-lfuse"  nul1fs.c   -o nul1fs
/tmp/ccbt0X7c.o: In function `main':
nul1fs.c:(.text+0x3c3): undefined reference to `fuse_main_real'
collect2: error: ld returned 1 exit status
make: *** [nul1fs] Error 1

It's a documented bug with a workaround: put the linker flags after the file lists. I.e. compile nul1fs with:

cc nul1fs.c -o nul1fs -lfuse

and not with make nul1fs, which boils down to

cc -lfuse nul1fs.c -o nul1fs
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top