在Mac OS X上编译FUSE文件系统出现问题

4

操作系统: OS X Mavericks (v10.9)

FUSE: OSXFUSE v2.6.2

我正在尝试编译C语言中的回环文件系统, 但是遇到了以下错误:

$ make
cc -D_FILE_OFFSET_BITS=64 -I/usr/local/include/osxfuse/fuse -Wall -g  -F/Library/Frameworks -o loopback loopback.c -losxfuse
ld: library not found for -losxfuse
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [loopback] Error 1

尝试编译 boxfs2 也会产生这个错误:

$ make
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libapp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libapp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libapp' found
Package libjson was not found in the pkg-config search path.
Perhaps you should add the directory containing `libjson.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libjson' found
Compiling boxfs.c
cc   -c boxfs.c -o boxfs.o
boxfs.c:15:10: fatal error: 'fuse.h' file not found
#include <fuse.h>
         ^
1 error generated.
make: *** [boxfs.o] Error 1

有人能指引我正确的方向吗?

1个回答

5
就第一个问题而言,您需要在编译器可以看到它的地方放置OSXFUSE库,或者您需要告诉编译器它在哪里。
您可以尝试使用mdfind来查找osxfuse库文件,然后将-L /path/to/osxfuse添加到编译/配置脚本中的Makefile中。
同样地,对于第二个问题,请确保boxfs2知道fuse头文件:看起来添加-I/usr/local/include/osxfuse/fuse就可以了。

哦:如果我猜的话,-L/usr/local/lib/osxfuse/ 可能是你要找的答案,但这只是我的猜测。 - Matthew G.
关闭。-L/usr/local/lib/ 解决了问题。不过还在尝试弄清楚 boxfs2。 - Jonukas

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接