Fuse functions not found on compile

I am working on a very simple file system for learning purposes, which uses fuse. However, I cannot compile it:

$ gcc -Wall `pkg-config fuse --cflags --libs` myfs.c -o myfs
/tmp/cc6xhGKO.o: In function `main':
myfs.c:(.text+0x1602): undefined reference to `fuse_opt_add_arg'
myfs.c:(.text+0x164f): undefined reference to `fuse_main_real'
collect2: ld returned 1 exit status

pkg-config already appends -lfuse (see below).

My system infos:

$ uname -a
Linux fpti 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ dpkg -l | grep fuse
ii  fuse                            2.8.6-2ubuntu2             Filesystem in Userspace
ii  libfuse-dev                     2.8.6-2ubuntu2             Filesystem in Userspace (development)
ii  libfuse2                        2.8.6-2ubuntu2             Filesystem in Userspace (library)
$ pkg-config fuse --cflags --libs
-D_FILE_OFFSET_BITS=64 -I/usr/include/fuse  -pthread -lfuse -lrt -ldl

Answers


-l options need to be after the thing that needs them. The --libs output doesn't work because it's in the wrong place. Move it after myfs.c


Need Your Help

How to determine Y Axis values on a chart

iphone objective-c graph charts

I'm working on a charting algorithm that will give me a set n array of y axis values I would use on my graph.