如何为 wine 提供现有 dll 文件的路径

如何为 wine 提供现有 dll 文件的路径

我尝试运行一个依赖于 .dll 的 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)

最让人恼火的是最后两行。/opt/qt/win32/qt/5.6/mingw49_32/bin//libwinpthread-1.dll.so如果没有后缀, Wine 会尝试打开 ,而这应该是正确的文件.so

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

答案1

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

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

确实有效。

相关内容