[Bug 878612] Re: Linker fails when compiling fuse files with "undefined reference to `fuse_main_real'

noon 878612 at bugs.launchpad.net
Wed Jul 3 08:26:55 UTC 2013


LDFLAGS is the variable for the linker flags.
Linker libs such as -lfuse should be put in the LDLIBS variable, not in LDFLAGS.

To solve the problem and simplify the Makefile at the same time:

In the Makefile, the LDFLAGS definition should be replaced with LDLIBS:

LDLIBS := $(shell pkg-config fuse --libs)

Also the 2-line fusexmp_fh section should be simplified with:

fusexml_fh: LDLIBS += -lulockmgr

(To make it even cleaner, there should be separate CFLAGS and CPPFLAGS
pkg-config settings: --cflags-only-other and --cflags-only-I
respectively)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to pkg-config in Ubuntu.
https://bugs.launchpad.net/bugs/878612

Title:
  Linker fails when compiling fuse files with "undefined reference to
  `fuse_main_real'

Status in “fuse” package in Ubuntu:
  Confirmed
Status in “pkg-config” package in Ubuntu:
  New

Bug description:
  I had a working Fuse application when using Ubuntu 11.04, and I'm 99.9% sure I've
  installed everything I need after re-installing Ubuntu 11.10.

  I installed libfuse-dev and copied the 
  /usr/share/doc/libfuse-dev/examples/hello.c file to /tmp and ran the the command
  listed at the top of the file:

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

  and it returns:

  /tmp/ccYYt1z4.o: In function `main':
  hello.c:(.text+0x33f): undefined reference to `fuse_main_real'
  collect2: ld returned 1 exit status

  libfuse-dev:
    Installed: 2.8.4-1.4ubuntu1
    Candidate: 2.8.4-1.4ubuntu1
    Version table:
   *** 2.8.4-1.4ubuntu1 0
          500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
          100 /var/lib/dpkg/status

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: libfuse-dev 2.8.4-1.4ubuntu1 [modified: usr/share/doc/libfuse-dev/changelog.Debian.gz]
  ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
  Uname: Linux 3.0.0-12-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 1.23-0ubuntu3
  Architecture: amd64
  Date: Wed Oct 19 19:00:51 2011
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20111004)
  SourcePackage: fuse
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fuse/+bug/878612/+subscriptions




More information about the foundations-bugs mailing list