Question

Hi guys hoping some of you solaris wizards might be able to point me in the right direction...

Background: I'm compiling a program that makes use of some of the zfs CLI code. (found here: https://github.com/illumos/illumos-gate/tree/master/usr/src/cmd/zfs)

Problem: libuutil.so.1 is present in /usr/lib but if I try to compile like so...

$ gcc -lzfs -L/usr/lib -luutil -lnvpair

ld: fatal: library -luutil: not found

Can anyone suggest a fix? Or a reason that the lib is not being found?

Thanks guys!

Était-ce utile?

La solution

You need to link to a libuutil.so library. As explained in a post pointed to by Ben van Gompel and in this post:
https://blogs.oracle.com/mandalika/entry/quick_fix_to_the_linker
You'd need to do:
ln -s /usr/lib/libuutil.so.1 /usr/lib/libuutil.so
This is because ld looks only for names that end in .so, not in number. This is a simple mechanism to have many versions of one library (version being designated by the number at the end) that can be used by compilation process.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top