如何在Xcode上运行hello world FUSE程序

时间:2014-07-15 07:05:12

标签: xcode macos filesystems fuse

我想知道在Xcode上运行这个Hello World程序的配置。我已经安装了MacOSXFUSE。 使用命令

gcc -Wall hello.c `pkg-config osxfuse --cflags --libs` -o hello

然后用

./hello outputdrive -f -s

我能够成功安装驱动器输出驱动器。

我有环境变量declare set as -x PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

MacOSXFUSE安装在/usr/local/include/osxfuse/

更多信息:

/usr/local/lib/pkgconfig/osxfuse.pc

此文件中的数据是

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: fuse
Description: OSXFUSE
Version: 2.7.3
Libs: -L${libdir} -losxfuse -pthread  -liconv
Cflags: -I${includedir}/osxfuse/fuse -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE

稍微进步,

我是在终端上做到的,

pkg-config osxfuse --cflags --libs

将以下结果粘贴在xocde中的“其他c标志”

-D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -L/usr/local/lib -losxfuse -pthread -liconv 

现在我收到以下错误,

Undefined symbols for architecture i386:
  "_fuse_main_real", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果需要更多详细信息,请与我们联系。

1 个答案:

答案 0 :(得分:1)

You need to put the /usr/local/lib in the "Library search paths" and the library "libosxfuze" to the "Linked Frameworks and Libraries". does it compile from command line? g++ hello.c -I/usr/local/include/osxfuse/fuse -D_FILE_OFFSET_BITS=64 -v -L/usr/local/lib -losxfuse