Hi all,
I'm using the Linux to MinGW cross compiler toolchain to build
windows binaries for one of my libraries. I'm also trying to
run the cross-compiled binaries that make up the test suite
under wine version 0.9.58 from ubuntu hardy heron.
The DLL for my library gets built as:
/home/erikd/Bzr/libsndfile-mingw/src/.libs/libsndfile-1.dll
and the test suite binaries get built in:
/home/erikd/Bzr/libsndfile-mingw/tests
If I go into that directory and run the following script:
#!/bin/bash
dll=libsndfile-1.dll
dlldir=/home/erikd/Bzr/libsndfile-mingw/src/.libs
if [ ! -f "$dlldir/$dll" ]; then
echo "Can't find DLL."
exit 1
fi
export WINEDLLPATH="$dlldir:$WINEDLLPATH"
exe=.libs/floating_point_test.exe
if [ -f $exe ]; then
exec $exe
fi
I get the following error message:
err:module:import_dll Library libsndfile-1.dll (which is needed
by L"Z:\\home\\erikd\\Bzr\\libsndfile-mingw\\tests\\.libs\\floating_point_test.exe")
not found
err:module:LdrInitializeThunk Main exe initialization for
L"Z:\\home\\erikd\\Bzr\\libsndfile-mingw\\tests\\.libs\\floating_point_test.exe"
failed, status c0000135
However, if I add a symbolic link in the current directory that links
to the DLL:
ln -s ../src/.libs/libsndfile-1.dll libsndfile-1.dll
it works.
Can anybody explain why the WINEDLLPATH doesn't seem to get picked
up?
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, you blow away your whole leg!"
-- Bjarne Stroustrup
WINEDLLPATH weirdness
Re: WINEDLLPATH weirdness
What happens if you do?
Code: Select all
if [ -f $exe ]; then
exec wine $exe
fi
WINEDLLPATH weirdness
vitamin wrote:
now I need to understand why.
The problem is that the script I posted is a very much cut
down version of the wrapper script generated by libtool.
If at all possible I'd like to be able to solve this problem
in a way that allows the libtool generated script to work.
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"The beauty of religious mania is that it has the power to
explain everything. Once God (or Satan) is accepted as the first
cause of everything which happens in the mortal world, nothing
is left to chance...logic can be happily tossed out the window."
- Stephen King
Wow! It works just like its supposed to. Thanks. UnfortunatelyWhat happens if you do?
Code:
if [ -f $exe ]; then
exec wine $exe
fi
now I need to understand why.
The problem is that the script I posted is a very much cut
down version of the wrapper script generated by libtool.
If at all possible I'd like to be able to solve this problem
in a way that allows the libtool generated script to work.
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"The beauty of religious mania is that it has the power to
explain everything. Once God (or Satan) is accepted as the first
cause of everything which happens in the mortal world, nothing
is left to chance...logic can be happily tossed out the window."
- Stephen King
Re: WINEDLLPATH weirdness
I'm guessing that binfmt won't use your environment for the security reasons.Erik de Castro Lopo wrote:vitamin wrote:
Wow! It works just like its supposed to. Thanks. UnfortunatelyWhat happens if you do?
Code:
if [ -f $exe ]; then
exec wine $exe
fi
now I need to understand why.
WINEDLLPATH weirdness
vitamin wrote:
while if I try to execute the windows exe directly it has to
go through the binfmt kernel module which has all sorts of
good reasons for not trusting the existing environment.
Looks like I've goot some libtool hacking ahead of me.
Thanks for the help.
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"If I were on life-support, I'd rather have it run by a Gameboy
than a Windows box."
-- Cliff Wells in comp.lang.python
Ah, of course, if I exec wine, the environment is preservedI'm guessing that binfmt won't use your environment for the
security reasons.
while if I try to execute the windows exe directly it has to
go through the binfmt kernel module which has all sorts of
good reasons for not trusting the existing environment.
Looks like I've goot some libtool hacking ahead of me.
Thanks for the help.
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"If I were on life-support, I'd rather have it run by a Gameboy
than a Windows box."
-- Cliff Wells in comp.lang.python
WINEDLLPATH weirdness
Erik de Castro Lopo wrote:
directory which pointed to the DLL.
I've updated my test script as follows:
#!/bin/bash
exe=`pwd`/.libs/floating_point_test.exe
dll=libsndfile-1.dll
dlldir=/home/erikd/Bzr/libsndfile-mingw/src/.libs
if [ ! -f $exe ]; then
echo "No exe. Stopping."
exit 1
fi
if [ ! -f "$dlldir/$dll" ]; then
echo "Can't find DLL."
exit 1
fi
echo "Trying with symlink"
ln -s "$dlldir/$dll" $dll
if [ -f $exe ]; then
wine $exe
fi
echo "Trying without symlink"
export WINEDLLPATH="$dlldir:$WINEDLLPATH"
if [ -f libsndfile-1.dll ]; then
echo "Deleting DLL symlink."
rm -f libsndfile-1.dll
fi
if [ -f $exe ]; then
wine $exe
fi
The first invocation of wine when the symlink is present works,
the second where I just try to rely on WINEDLLPATH doesn't.
Is it possible that wine is ignoring WINEDLLPATH?
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Linux, the UNIX defragmentation tool.
Sorry, that was a mistake, I still had a symlink in the localvitamin wrote:
Wow! It works just like its supposed to. Thanks. UnfortunatelyWhat happens if you do?
Code:
if [ -f $exe ]; then
exec wine $exe
fi
now I need to understand why.
directory which pointed to the DLL.
I've updated my test script as follows:
#!/bin/bash
exe=`pwd`/.libs/floating_point_test.exe
dll=libsndfile-1.dll
dlldir=/home/erikd/Bzr/libsndfile-mingw/src/.libs
if [ ! -f $exe ]; then
echo "No exe. Stopping."
exit 1
fi
if [ ! -f "$dlldir/$dll" ]; then
echo "Can't find DLL."
exit 1
fi
echo "Trying with symlink"
ln -s "$dlldir/$dll" $dll
if [ -f $exe ]; then
wine $exe
fi
echo "Trying without symlink"
export WINEDLLPATH="$dlldir:$WINEDLLPATH"
if [ -f libsndfile-1.dll ]; then
echo "Deleting DLL symlink."
rm -f libsndfile-1.dll
fi
if [ -f $exe ]; then
wine $exe
fi
The first invocation of wine when the symlink is present works,
the second where I just try to rely on WINEDLLPATH doesn't.
Is it possible that wine is ignoring WINEDLLPATH?
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Linux, the UNIX defragmentation tool.