makefile - 在 Debian 上安装 nullfs

标签 makefile fuse cc

我正在使用 java 程序。它会自动在一个目录中创建日志文件,但我自己使用 tee 以不同的方式创建日志文件。我找不到禁用日志的简单方法,所以我求助于使用 nullfs。

我克隆了它

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

然后我跑了

make nul1fs

按照指示。它在一秒钟内终止,输出如下:

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

我尝试了 apt-get source fuse 并将 fuse.h 复制到 nullfs 目录中,但没有任何改变。 我安装了 fuse 。我正在运行 Debian wheezy x86_64。

最佳答案

您需要 FUSE 的开发包,其中包含您缺少的 fuse.h。执行 apt-get install libfuse-dev 它应该可以工作。

复制源目录中的头文件不起作用,因为在 nul1fs.c 中您会注意到 fuse.h 包含在尖括号中。这意味着,将在系统范围的包含路径中搜索头文件。这通常意味着 /usr/include


请注意,您随后可能会遇到此错误:

$ 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

这是一个documented bug有一个解决方法:将链接器标志放在文件列表之后。 IE。编译 nul1fs:

cc nul1fs.c -o nul1fs -lfuse

而不是 make nul1fs,归结为

cc -lfuse nul1fs.c -o nul1fs

关于makefile - 在 Debian 上安装 nullfs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23313677/

相关文章:

c++ - 为什么 FUSE 似乎要锁定所有线程?

fuse - 实现 fuse

java - eclipse : "make: *** No rule to make target ` 全部'。停止。”

Makefile 中找不到命令错误

makefile 缺少分隔符

ubuntu - 如何使用 Minio 作为 BindFS 挂载的前端

c - CC/GCC 但不是 G++ (C/SDL2/Linux) 的奇怪段错误

rust - Rust 语言编译问题 : starting with 'Hello World'

c++ - 在UNIX上 “internal compiler error: storage failure”是什么意思?

c - 无法使用Makefile链接数学库