Can't load native dll

lawson_whitney at juno.com lawson_whitney at juno.com
Wed Apr 24 11:10:11 CDT 2002


On Wed, 24 Apr 2002, Andriy Palamarchuk wrote:

> Lawson, thank you for the detailed response.
>
> > Only guessing, of course.
>
> I think this is a different problem. I came across the
> issue when I tried to create a unit test which loads
> itself as dll.
>
> I took your test application, renamed it to "test",
> built as Winelib application and tried to load itself.
>
> Results:
> $ ./test ./test.so
> /./test ./test.so/
> arg 0: /./test/
> arg 1: /./test.so/
> err:module:MODULE_LoadLibraryExA Loading of native DLL
> F:\prj\wine_test\test.so failed (error 193), check
> this file.
> handle 0 last error 193
>
> Can you do this?
>
> The results is the same whatever I put in the first
> place in config file:
> ;default for all other dlls
> "*" = "native, builtin, so"
>
> Andriy Palamarchuk

By default, winemaker makes a pseudo-exe that has to be loaded with
Wine using WINEPRELOAD or tricks with symbolic links or a copy of wine
named for the .exe without the .exe suffix.
It makes a copy of wine named FI cmdl to load the .so file from the
command line.

I was actually using lcc-win to make cmdl.exe.
If you tell winemaker to make a dll instead of an exe (note there is a
place for it in the spec file) it makes a dll named libname.so and
noting to load it with.  I think it may be a bit out of sync with
Alexandre's dll naming scheme, which just changed a bit.  The lib prefix
has fallen off most of the builtin dlls, and winemaker hasn't caught up
with this yet.

cmdl.exe (by lcc-win) can load cmdl by winemaker with the dll option,
but - even in windows, can you run a dll from the command line?  I have
no success with it from the unix command line.  In effect, wine builtin
dlls are not unix executables nor shared libraries exactly, but
elf-format pseudo PE libraries.  You can't load them with dlopen, you
have to use wine on them.  That's sort of why the moved to
/usr/local/lib/wine in a default configuration, and that doesn't go in
/etc/ld.so.conf nor LD_LIBRARY_PATH.

Also, I think winelib programs and dlls don't get argc and argv[], so I
have been getting segment faults.

Wine doesn't expect to be told to load a builtin dll by the unix
filename, but by the windows name, I think.  This is getting a bit over
my head, but in case it may help...

Lawson

[whit at giftie cmdw]$ ../cmdl/cmdl.exe libcmdw
bash: ../cmdl/cmdl.exe: cannot execute binary file
[whit at giftie cmdw]$ wine ../cmdl/cmdl.exe libcmdw
/../cmdl/cmdl.exe libcmdw/
arg 0: /../cmdl/cmdl.exe/
arg 1: /libcmdw/
h 0 le 2
[whit at giftie cmdw]$ wine ../cmdl/cmdl.exe libcmdw.so
/../cmdl/cmdl.exe libcmdw.so/
arg 0: /../cmdl/cmdl.exe/
arg 1: /libcmdw.so/
err:module:MODULE_LoadLibraryExA Loading of native DLL H:\tools\cmdw\libcmdw.so
failed (error 193), check this file.
h 0 le 193
[whit at giftie cmdw]$
[whit at giftie cmdw]$ export WINEDLLPATH="/home/whit/tools/cmdw"
[whit at giftie cmdw]$ printenv | grep -i wine
WINEDLLPATH=/home/whit/tools/cmdw
[whit at giftie cmdw]$ wine ../cmdl/cmdl.exe cmdw
/../cmdl/cmdl.exe cmdw/
arg 0: /../cmdl/cmdl.exe/
arg 1: /cmdw/
h 0 le 2
[whit at giftie cmdw]$ wine ../cmdl/cmdl.exe libcmdw
/../cmdl/cmdl.exe libcmdw/
arg 0: /../cmdl/cmdl.exe/
arg 1: /libcmdw/
h 0 le 2
[whit at giftie cmdw]$ mv libcmdw.so cmdw.dll.so
[whit at giftie cmdw]$ wine ../cmdl/cmdl.exe cmdw
/../cmdl/cmdl.exe cmdw/
arg 0: /../cmdl/cmdl.exe/
arg 1: /cmdw/
/../cmdl/cmdl.exe cmdw/
[whit at giftie cmdw]$

This last got a c0000005 exception from lcc runtime, but I think that
is that a dll doesn't get argc and argv[] but this one tries to use
them.  I will test a bit more later.



________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.



More information about the wine-users mailing list