On Wed, Jul 30, 2025 at 02:30:44PM +0300, Eli Zaretskii wrote: > > Date: Tue, 29 Jul 2025 18:53:41 +0200 > > From: Patrice Dumas <pertu...@free.fr> > > Cc: bug-texinfo@gnu.org > > > > On Tue, Jul 29, 2025 at 07:04:27PM +0300, Eli Zaretskii wrote: > > > It's very simple: you need to make sure the directory where the DLL > > > lives is on PATH or in the same directory from where you invoke the > > > program which needs the DLL. > > > > Are you sure that what you describe is valid for Perl extensions? > > That's how Windows finds DLLs, regardless of their purpose. > > > We > > often load objects (through Perl Dynaloader) that are in different > > locations that seems to be loaded (through something like dlopen) as > > long as the filename is available. > > If the file name includes leading directories, and is correct, it > doesn't have to be on PATH. But I'm not sure the file name is correct > in these cases
Ok. My reading of the logs showed a correct path, but it could indeed be incorrect. What makes the error even harder to understand is that the Dynaloader error is for the call of dl_load_file, the file should already have been found with dl_findfile. > GetModuleHandle is only relevant when the module (DLL in this case) > was already loaded into the process. Not sure how it is relevant > here. You are right, I misread. The function called seems to be LoadLibraryExA, with the LOAD_WITH_ALTERED_SEARCH_PATH flag set and (but the code is hard to read) probably the absolute directory/file name obtained with GetCurrentDirectoryA (which I assumed to be the same as GetCurrentDirectory) in argument. > What happens if you copy the DLL to the place where DynaLoader.pm > claims that it looks for it. IOW, replace the symlink with a copy of > the DLL itself. Does the problem go away? In one case, there is no symlink involved, there is an error with the path (Can't load '../../swig/perl/.libs/Texinfo.dll'). In any case, there would be a need for a direct access to the platform to check that, and also to check that the path without symlink is actually correct. Other possibilities could be / vs \ (although the code in Perl turns / to \ before calling LoadLibraryExA, and we do not have trouble with / when we use our XSLoader to call Dynaloader) and/or pure Windows versus Cygwin. -- Pat