Problems compiling liboath on Windows-Mingw
Hello, I was trying to compile liboath on windows with msys2 and mingw64.
This is the output of ./configure
https://gist.github.com/TheZ3ro/737c14dca2f914603356fa8f59fc7c17
This is the error when running make
in the liboath folder
usersfile.c: In function 'parse_usersfile':
usersfile.c:175:9: warning: implicit declaration of function 'strptime' [-Wimplicit-function-declaration]
ts = strptime (p, TIME_FORMAT_STRING, &tm);
^~~~~~~~
usersfile.c:175:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
ts = strptime (p, TIME_FORMAT_STRING, &tm);
^
usersfile.c: In function 'update_usersfile':
usersfile.c:340:18: error: storage size of 'l' isn't known
struct flock l;
^
usersfile.c:346:16: error: 'F_WRLCK' undeclared (first use in this function)
l.l_type = F_WRLCK;
^~~~~~~
usersfile.c:346:16: note: each undeclared identifier is reported only once for each function it appears in
usersfile.c:348:18: warning: implicit declaration of function 'fcntl' [-Wimplicit-function-declaration]
while ((rc = fcntl (fileno (lockfh), F_SETLKW, &l)) < 0 && errno == EINTR)
^~~~~
usersfile.c:348:42: error: 'F_SETLKW' undeclared (first use in this function)
while ((rc = fcntl (fileno (lockfh), F_SETLKW, &l)) < 0 && errno == EINTR)
^~~~~~~~
usersfile.c:389:24: warning: implicit declaration of function 'fsync' [-Wimplicit-function-declaration]
if (rc == OATH_OK && fsync (fileno (outfh)) != 0)
^~~~~
usersfile.c: In function 'oath_authenticate_usersfile':
usersfile.c:475:11: warning: implicit declaration of function 'localtime_r' [-Wimplicit-function-declaration]
if (localtime_r (&t, &now) == NULL)
^~~~~~~~~~~
usersfile.c:475:34: warning: comparison between pointer and integer
if (localtime_r (&t, &now) == NULL)
^~
I think there are some problem including fcntl.h but setting --includedir=/usr/include
with configure doesn't solve this.
Do you have any ideas?
Thanks.