GNU bug report logs - #78682
Building libltdl with MSVC fails

Previous Next

Package: libtool;

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

Date: Tue, 3 Jun 2025 16:58:02 UTC

Severity: normal

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

Full log


View this message in rfc822 format

From: Kirill Makurin <maiddaisuki <at> outlook.com>
To: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>, "78682 <at> debbugs.gnu.org" <78682 <at> debbugs.gnu.org>
Subject: bug#78682: Building libltdl with MSVC fails
Date: Thu, 5 Jun 2025 09:13:34 +0000
[Message part 1 (text/plain, inline)]
Hi Ileana,

I tried building from development branch and it has the same issue.

Out of curiosity I also tried to use clang-cl.exe (this is a clang which understands many of cl.exe's options), and I see the following:

```
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 (mingw/MSVC), `access` function is declared in io.h. You may use the following condition to recognize native Windows:

```
#if defined (_WIN32) && !defined (__CYGWIN__)
#endif
```

- Kirill Makurin

________________________________
From: Ileana Dumitrescu
Sent: Thursday, June 5, 2025 12:13 AM
To: 78682 <at> debbugs.gnu.org
Cc: Kirill Makurin
Subject: Re: bug#78682: Building libltdl with MSVC fails

On 03/06/2025 17:29, Kirill Makurin wrote:
> Hi,

Hi!

>
> Building libltdl with MSVC fails:
>
> ```
> libltdl_la-ltdl.obj : error LNK2019: unresolved external symbol
> lt_ltdl_LTX_preloaded_symbols referenced in function lt_dlinit
> libltdl\.libs\libltdl-7.dll : fatal error LNK1120: 1 unresolved externals
> ```
>
> I attached full invocation in separate file since it's quite messy.
>
> I did some investigation.
>
> Apparently, `lt_ltdl_LTX_preloaded_symbols` is supposed to be defined in
> libtool-generated `libltdl/.libs/libltdlS.c`, however it defines
> `lt_libltdl_LTX_preloaded_symbols` instead, as if it was mingw build.
>
> I was building from libtool-2.5.4 release tarball. I tried building from
> `master` and the issue also exist there.

Most if not all MSVC-related fixes are in the 'development' branch for
review and testing before I migrate them to master. Would you try
building libltdl with MSVC using development source code?

> Thank you for working on MSVC-related issues. I have some other things
> to report/suggest.

Thank you for your detailed bug reports!

--
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354

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

This bug report was last modified 11 days ago.

Previous Next


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