gcc - Compilation error: Undefined reference to -
i'm working on c program getting events udev. program has been compiled , tested on host running debian (with gcc 4.7.2-5).
recently, switched ubuntu 12.04 lts (with gcc 4.6.3). same program fails compile , halts during linking phase.
automounter_main.c:(.text+0xd4e): undefined reference `udev_new' automounter_main.c:(.text+0xe02): undefined reference `udev_device_new_from_devnum' automounter_main.c:(.text+0xeb0): undefined reference `udev_device_new_from_syspath' automounter_main.c:(.text+0xf63): undefined reference `udev_device_get_sysattr_list_entry' automounter_main.c:(.text+0xf77): undefined reference `udev_list_entry_get_name' automounter_main.c:(.text+0xf85): undefined reference `udev_device_get_sysattr_value' automounter_main.c:(.text+0x100a): undefined reference `udev_device_get_sysattr_value' automounter_main.c:(.text+0x1055): undefined reference `udev_device_get_sysattr_value' automounter_main.c:(.text+0x1078): undefined reference `udev_list_entry_get_next' automounter_main.c:(.text+0x108c): undefined reference `udev_device_get_parent' automounter_main.c:(.text+0x1118): undefined reference `udev_device_unref' automounter_main.c:(.text+0x1122): undefined reference `udev_unref'
the following steps taken, nothing seems work.
- install packages related udev (udev, libudev-dev, libudev0). packages reported latest.
- create symlink in /usr/lib pointing correct udev library.
- upgraded libc package
symlink verified using:
$ ls -l libudev* lrwxrwxrwx 1 root root 39 nov 27 15:57 libudev.so -> /lib/x86_64-linux-gnu/libudev.so.0.13.0)
kindly me find way resolve error.
thanks in advance.
my guess need move -ludev
end of linking command line.
Comments
Post a Comment