如何给 wine 一个现有 dll 文件的路径

Rud*_*udi 7 wine

我尝试运行一个 Windows 程序,它依赖于一个 .dll,它既不在当前目录中也不在程序目录中。该文档提到“WINEDLLPATH”变量用于提示在何处搜索库。但是即使设置了这个变量,我也无法运行程序:

/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)
Run Code Online (Sandbox Code Playgroud)

刺激的部分是最后两行。/opt/qt/win32/qt/5.6/mingw49_32/bin//libwinpthread-1.dll.so如果没有.so后缀,Wine 会尝试打开,这将是正确的文件。

有没有办法说服 wine 以/opt/qt/win32/qt/5.6/mingw49_32/bin/与处理 $PWD 或程序目录中的文件相同的方式考虑 .dll 文件?

Rud*_*udi 8

我发现,wine 提供了WINEPATH-variable,它添加了额外的路径来查找其他库。

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
Run Code Online (Sandbox Code Playgroud)

确实有效。

  • `WINEPATH` 也可以有多个条目,但它们像 Windows `%PATH%` 变量一样用分号分隔。 (2认同)