10

I try to run a windows program, which relies on a .dll, which is neither in the current directory nor in the directory of the program. The documentation mentions that the "WINEDLLPATH"-variable is used to give a hint for where to search for libraries. But I can't run the program even when this variable is set:

/home/rudi/foobar $ WINEDLLPATH=/opt/qt/win32/qt/5.6/mingw49_32/bin/ strace -o /tmp/cc1.log /opt/qt/win32/qt/Tools/mingw492_32/libexec/gcc/i686-w64-mingw32/4.9.2/cc1.exe --help
fixme:winediag:start_process Wine Staging 1.9.12 is a testing version containing experimental patches.
fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
err:module:import_dll Library libwinpthread-1.dll (which is needed by L"Z:\\opt\\qt\\win32\\qt\\Tools\\mingw492_32\\libexec\\gcc\\i686-w64-mingw32\\4.9.2\\cc1.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\opt\\qt\\win32\\qt\\Tools\\mingw492_32\\libexec\\gcc\\i686-w64-mingw32\\4.9.2\\cc1.exe" failed, status c0000135

/home/rudi/foobar $ grep libwinpthread-1.dll /tmp/cc1.log                                                                                                              
stat64("/home/rudi/.wine/dosdevices/z:/opt/qt/win32/qt/Tools/mingw492_32/libexec/gcc/i686-w64-mingw32/4.9.2/libwinpthread-1.dll", 0xffcdf99c) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/z:/opt/qt/win32/qt/Tools/mingw492_32/libexec/gcc/i686-w64-mingw32/4.9.2/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/z:/home/rudi/foobar/libwinpthread-1.dll", 0xffcdf99c) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/z:/home/rudi/foobar/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/c:/windows/syswow64/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/c:/windows/system/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/c:/windows/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/c:/windows/syswow64/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/c:/windows/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
stat64("/home/rudi/.wine/dosdevices/c:/windows/syswow64/wbem/libwinpthread-1.dll", 0xffcdf694) = -1 ENOENT (No such file or directory)
open("/lib/wine/libwinpthread-1.dll.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/wine/libwinpthread-1.dll.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/opt/qt/win32/qt/5.6/mingw49_32/bin//libwinpthread-1.dll.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/qt/win32/qt/5.6/mingw49_32/bin//libwinpthread-1.dll.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

The irritating part are the last two lines. Wine tries to open /opt/qt/win32/qt/5.6/mingw49_32/bin//libwinpthread-1.dll.so, which would be the correct file, if there was not the .so suffix.

Is there a way to persuade wine to consider the .dll files at /opt/qt/win32/qt/5.6/mingw49_32/bin/ the same way it treats files from $PWD or the program directory?

Rudi
  • 333
  • 1
  • 3
  • 9
  • Have you tried setting a link (hard or symbolic) between the names? If you use a symbolic link, you will need an absolute path. – AFH May 15 '17 at 14:26

1 Answers1

13

I found out, that wine offers the WINEPATH-variable, which adds additional paths to look out for other libraries.

WINEPATH=/opt/qt/win32/qt/5.6/mingw49_32/bin/ /opt/qt/win32/qt/Tools/mingw492_32/libexec/gcc/i686-w64-mingw32/4.9.2/cc1.exe --help

does work.

sjngm
  • 2,101
  • 3
  • 21
  • 29
Rudi
  • 333
  • 1
  • 3
  • 9
  • 1
    y u have not marked this answer as accepted? –  Jul 22 '19 at 11:41
  • 2
    `WINEPATH` can also have multiple entries, but they're separated by _semicolons_ like the windows `%PATH%` variable. – Dan Aug 20 '20 at 23:41