GNU bug report logs - #78701
Undeclared reference to access on Windows

Previous Next

Package: libtool;

Reported by: Kirill Makurin <maiddaisuki <at> outlook.com>

Date: Thu, 5 Jun 2025 16:24:02 UTC

Severity: normal

Done: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kirill Makurin <maiddaisuki <at> outlook.com>
To: 78701 <at> debbugs.gnu.org
Subject: bug#78701: Undeclared reference to access on Windows
Date: Thu, 5 Jun 2025 16:22:42 +0000
[Message part 1 (text/plain, inline)]
Building libltdl on Windows using clang-cl.exe fails with the following diagnostic:

```
H:/git/libtool/libltdl/ltdl.c(781,19): error: call to undeclared function 'access'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  781 |   int           notfound        = access (filename, R_OK);
      |                                   ^
H:/git/libtool/libltdl/ltdl.c(781,19): note: did you mean 'accept'?
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um\winsock.h(739,19): note: 'accept' declared here
  739 | SOCKET PASCAL FAR accept (
      |                   ^
```

On native Windows (MSVC/mingw), access is declared in io.h, which is not included. (On mingw, it could be indirectly included from
other header files.)

A solution would be to add

```
#if defined (_WIN32) && !defined (__CYGWIN__)
#include <io.h>
#endif
```

on top of libltdl/ltdl.c.

- Kirill Makurin

[Message part 2 (text/html, inline)]

This bug report was last modified 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.