Could not run an .exe file with wine
Eric
ejazzkatt at gmail.com
Mon Jun 25 15:29:48 UTC 2007
Laurent wrote:
>
> # wine application.exe
> gives me:
> err:module:import_dll Library MFC42.DLL (which is needed by L"D:
> \\torrents\\application.exe") not found
> err:module:LdrInitializeThunk Main exe initialization for L"D:
> \\torrents\\application.exe" failed, status c0000135
>
> where application.exe has in fact another name but this is of no importance
> here. name is more complicated to type that "application.exe" ...
>
> Laurent
>
It's telling you what the problem is. It can't find that.dll file. That
means you will have to find it and copy it into your wine setup. That's
simple enough to do.
I copied the text beloe from WineHQ
http://www.winehq.org/site/docs/wineusr-guide/config-wine-main#AEN241
3.1.2. Libraries Settings
Likewise, some applications require specific libraries in order to run.
Wine reproduces the Windows system libraries (so-called native DLL's)
with completely custom versions designed to function exactly the same
way but without requiring licenses from Microsoft. Wine has many known
deficiencies in it's built-in versions, but in many instances the
functionality is sufficient. Using only builtin DLL's ensures that your
system is Microsoft-free. However, Wine has the ability to load native
Windows DLL's.
3.1.2.1. DLL Overrides
It's not always possible to run an application on builtin DLL's.
Sometimes native DLL's simply work better. After you've located a native
DLL on a Windows system, you'll need to put it in suitable place for
Wine to find it and then configure it to be used. Generally the place
you need to put it is in the directory you've configured to be
c:\windows\system32 (more on that in the drives section). There are four
DLL's you should never try to use the native versions of: kernel32.dll,
gdi32.dll, user32.dll, and ntdll.dll. These libraries require low-level
Windows kernel access that simply doesn't exist within Wine.
With that in mind, once you've copied the DLL you just need to tell Wine
to try to use it. You can configure Wine to choose between native and
builtin DLL's at two different levels. If you have Default Settings
selected in the Applications tab, the changes you make will affect all
applications. Or, you can override the global settings on a
per-application level by adding and selecting an application in the
Applications tab.
To add an override for FOO.DLL, enter "FOO" into the box labeled New
override for library: and click on the Add button. To change how the DLL
behaves, select it within the Existing overrides: box and choose Edit.
By default the new load order will be native Windows libraries before
Wine's own builtin ones (Native then Builtin). You can also choose
native only, builtin only, or disable it altogether.
3.1.2.2. Notes About System DLL's
The Wine team has determined that it is necessary to create fake DLL
files to trick many programs that check for file existence to determine
whether a particular feature (such as Winsock and its TCP/IP networking)
is available. If this is a problem for you, you can create empty files
in the configured c:\windows\system32 directory to make the program
think it's there, and Wine's built-in DLL will be loaded when the
program actually asks for it. (Unfortunately, tools/wineinstall does not
create such empty files itself.)
Applications sometimes also try to inspect the version resources from
the physical files (for example, to determine the DirectX version).
Empty files will not do in this case, it is rather necessary to install
files with complete version resources. This problem is already fixed for
many files. For others, you may still need to grab some real DLL files
to fool these apps with.
There are of course DLLs that Wine does not currently implement very
well (or at all). If you do not have a real Windows you can copy
necessary DLLs from, you can always get some from one of the Windows DLL
archive sites that can be found via internet search engine. Please make
sure to obey any licenses on the DLLs you fetch; some are
redistributable, some aren't.
3.1.2.3. Missing DLL's
In case Wine complains about a missing DLL, you should check whether
this file is a publicly available DLL or a custom DLL belonging to your
program (by searching for its name on the internet). After you've
located the DLL, you need to make sure Wine is able to use it. DLLs
usually get loaded in the following order:
1.
The directory the program was started from.
2.
The current directory.
3.
The Windows system directory.
4.
The Windows directory.
5.
The PATH variable directories.
In short: either put the required DLL into your program directory (might
be ugly), or put it into the Windows system directory. Also, if possible
you probably shouldn't use NT-based native DLLs, since Wine's NT API
support is somewhat weaker than its Win9x API support (possibly leading
to even worse compatibility with NT DLLs than with a no-windows setup!).
Eric
More information about the kubuntu-users
mailing list