[Bug 257222] Cannot use libzfs.h from user space programs due to missing libnvpair.h and other dependencies
Date: Sun, 02 Jan 2022 15:44:24 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257222
Michael Gmelin <grembo@FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|Affects Only Me |Affects Some People
Status|Closed |Open
CC| |grembo@FreeBSD.org
Resolution|Works As Intended |---
--- Comment #2 from Michael Gmelin <grembo@FreeBSD.org> ---
(In reply to Alan Somers from comment #1)
Re-opening, as even if using libzfs_core.h kernel sources are required, so all
the problems described by the bug author still exist.
This is how /usr/include/libzfs_core.h begins:
```
#ifndef _LIBZFS_CORE_H
#define _LIBZFS_CORE_H
#include <libnvpair.h>
```
Minimal example:
```
$ cat >test.c <<EOF
#include <libzfs_core.h>
int main()
{
}
EOF
$ cc test.c
/usr/include/libzfs_core.h:32:10: fatal error: 'libnvpair.h' file not found
#include <libnvpair.h>
^~~~~~~~~~~~~
1 error generated.
$ find / -name libnvpair.h
/usr/src/sys/contrib/openzfs/include/libnvpair.h
Try adding it to the search path:
$ cc -I/usr/src/sys/contrib/openzfs/include test.c
tons of errors, many more include paths required...
```
--
You are receiving this mail because:
You are the assignee for the bug.