Added some additional definitions in the udev.def ...
# kotlin-native
n
Added some additional definitions in the udev.def file, and encountered a linking error, where it isn't clear what is causing the error:
Copy code
Task :cinteropUdevLinux FAILED
Exception in thread "main" java.lang.Error: /tmp/tmp360311134357443805.c:26:3: error: expected expression
Below are the definitions added to the file:
Copy code
static inline void set_fd(int fd, fd_set *set) {
  FD_SET(fd, fd_set);
}

static inline void zero_fd(fd_set *set) {
  FD_ZERO(fd_set);
}

static inline int fd_is_set(int fd, fd_set *set) {
  int result = FS_ISSET(fd, fd_set);
  return result;
}
b
Can we see the contents of the temp file?
n
Are you referring to the udev.def file?
Definition file for the udev library.
m
You didn't include header where
FD_SET
is defined.
n
With the deb package that is used (name: libudev-dev, version: 237-3ubuntu10.25) the source doesn't seem to exist anywhere, which makes it very difficult to track down missing definitions.
m
Hm, difficult? First link in google FD_SET
#include <sys/select.h>
n
The libudev has its own version of fd_set (struct) and related macros.
m
Are you sure? AFAIK
libudev
is part of
systemd
, so I cloned
systemd
sources - there is not single occurence of
FD_SET
,
n
That is very strange since libudev used to be separate 🤔.
m
"In April 2012, udev's codebase was merged into the systemd source tree, making systemd 183 the first version to include udev"
b
referring to
Exception in thread "main" java.lang.Error: /tmp/tmp360311134357443805.c:26:3: error: expected expression
. Presumably that .c is something K/N generated from your def file or something like that, we might be able to work backwards from there to figure it out
m
Obvious: 26:3 is line:column starting from
===
line
👍 2