LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   /usr/bin/ld: cannot find -lxenctrl (https://www.linuxquestions.org/questions/linux-general-1/usr-bin-ld-cannot-find-lxenctrl-863891/)

MrUmunhum 02-20-2011 12:59 PM

/usr/bin/ld: cannot find -lxenctrl
 
Hi group,

Not sure if this is the right spot?

Trying to build kexec, I get this error:
gcc -lxenctrl -lz --no-undefined -nostartfiles -nostdlib -nodefaultlibs -e purgatory_start -r -o purgatory/purgatory.ro purgatory/purgatory.o purgatory/printf.o purgatory/string.o purgatory/arch/x86_64/entry64-32.o purgatory/arch/x86_64/entry64.o purgatory/arch/x86_64/setup-x86_64.o purgatory/arch/x86_64/stack.o purgatory/arch/x86_64/purgatory-x86_64.o purgatory/arch/i386/entry32-16.o purgatory/arch/i386/entry32-16-debug.o purgatory/arch/i386/crashdump_backup.o purgatory/arch/i386/console-x86.o purgatory/arch/i386/vga.o purgatory/arch/i386/pic.o purgatory/sha256.o
Live child 0x00f88730 (purgatory/purgatory.ro) PID 7319
/usr/bin/ld: cannot find -lxenctrl
libxenctrl is there:
ls -lrat /usr/lib*/libxenctrl*
-rwxr-xr-x 1 root root 98176 2010-06-20 10:08 /usr/lib/libxenctrl.so.3.4.0
-rwxr-xr-x 1 root root 89584 2010-06-20 10:09 /usr/lib64/libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 19 2011-02-20 10:18 /usr/lib/libxenctrl.so.3.4 -> libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 19 2011-02-20 10:18 /usr/lib64/libxenctrl.so.3.4 -> libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 28 2011-02-20 10:22 /usr/lib/libxenctrl.so -> /usr/lib/libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 17 2011-02-20 10:36 /usr/lib64/libxenctrl.so -> libxenctrl.so.3.4

echo $LD_LIBRARY_PATH
.:/lib:/usr/lib:/usr/lib64

Any ideas??

z1p 02-20-2011 01:17 PM

Quote:

Originally Posted by MrUmunhum (Post 4264931)
Hi group,

Not sure if this is the right spot?

Trying to build kexec, I get this error:
gcc -lxenctrl -lz --no-undefined -nostartfiles -nostdlib -nodefaultlibs -e purgatory_start -r -o purgatory/purgatory.ro purgatory/purgatory.o purgatory/printf.o purgatory/string.o purgatory/arch/x86_64/entry64-32.o purgatory/arch/x86_64/entry64.o purgatory/arch/x86_64/setup-x86_64.o purgatory/arch/x86_64/stack.o purgatory/arch/x86_64/purgatory-x86_64.o purgatory/arch/i386/entry32-16.o purgatory/arch/i386/entry32-16-debug.o purgatory/arch/i386/crashdump_backup.o purgatory/arch/i386/console-x86.o purgatory/arch/i386/vga.o purgatory/arch/i386/pic.o purgatory/sha256.o
Live child 0x00f88730 (purgatory/purgatory.ro) PID 7319
/usr/bin/ld: cannot find -lxenctrl
libxenctrl is there:
ls -lrat /usr/lib*/libxenctrl*
-rwxr-xr-x 1 root root 98176 2010-06-20 10:08 /usr/lib/libxenctrl.so.3.4.0
-rwxr-xr-x 1 root root 89584 2010-06-20 10:09 /usr/lib64/libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 19 2011-02-20 10:18 /usr/lib/libxenctrl.so.3.4 -> libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 19 2011-02-20 10:18 /usr/lib64/libxenctrl.so.3.4 -> libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 28 2011-02-20 10:22 /usr/lib/libxenctrl.so -> /usr/lib/libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 17 2011-02-20 10:36 /usr/lib64/libxenctrl.so -> libxenctrl.so.3.4

echo $LD_LIBRARY_PATH
.:/lib:/usr/lib:/usr/lib64

Any ideas??

I highlighted the problem above. Your LD_LIBRARY_PATH includes /usr/lib64, which contains a symbolic link for libxenctrl.so that points to libxenctrl.so.3.4. However the name of the .so file is really libxenctrl.so.3.4.0, so it is not found. You need to fix your symbolic link. As they say 'The devil is in the details.' ;)

Good Luck
-z1p

MrUmunhum 02-21-2011 03:06 PM

Quote:

Originally Posted by z1p (Post 4264948)
I highlighted the problem above. Your LD_LIBRARY_PATH includes /usr/lib64, which contains a symbolic link for libxenctrl.so that points to libxenctrl.so.3.4. However the name of the .so file is really libxenctrl.so.3.4.0, so it is not found. You need to fix your symbolic link. As they say 'The devil is in the details.' ;)

Good Luck
-z1p

Thanks for the response. I think I made a copy/paste error and truncated the '.0' off the end of the line.
Here is the right list:
ls -lrat /usr/lib*/libxenctrl*
-rwxr-xr-x 1 root root 98176 2010-06-20 10:08 /usr/lib/libxenctrl.so.3.4.0
-rwxr-xr-x 1 root root 89584 2010-06-20 10:09 /usr/lib64/libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 19 2011-02-20 10:18 /usr/lib/libxenctrl.so.3.4 -> libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 19 2011-02-20 10:18 /usr/lib64/libxenctrl.so.3.4 -> libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 28 2011-02-20 10:22 /usr/lib/libxenctrl.so -> /usr/lib/libxenctrl.so.3.4.0
lrwxrwxrwx 1 root root 30 2011-02-21 12:46 /usr/lib64/libxenctrl.so -> /usr/lib64/libxenctrl.so.3.4.0
I think the problem is the level of libxenctrl?? Is there a way to get the compiler to display what version of the libs it wants??

z1p 02-21-2011 10:25 PM

The -lxenctrl option tells the linker to looks for libxenctrl.so with no version number. So, /usr/lib64/libxenctrl.so should satisfy the linker.

So you're still getting the same error with the current symbolic links?

Its looking right to me.

Have you tried explicitly looking in /usr/lib64 with "-L/usr/lib64" on the compile line?


All times are GMT -5. The time now is 05:53 PM.