Wine can't find/load DLLs in the same dir

Questions about Wine on Linux
Locked
olpchk
Newbie
Newbie
Posts: 2
Joined: Thu Dec 23, 2021 11:38 am

Wine can't find/load DLLs in the same dir

Post by olpchk »

Hello
I'm trying to start my app like this:

Code: Select all

wine ./sss.exe
but got these errors:

Code: Select all

002c:err:module:import_dll Loading library nnn.dll (which is needed by L"Z:\\home\\pfga\\app\\sss.exe") failed (error c000012f).
002c:err:module:import_dll Loading library nnn.dll (which is needed by L"Z:\\home\\pfga\\app\\vvv.dll") failed (error c000012f).
002c:err:module:import_dll Library vvv.dll (which is needed by L"Z:\\home\\pfga\\app\\sss.exe") not found
002c:err:module:attach_dlls Importing dlls for L"Z:\\home\\pfga\\app\\sss.exe" failed, status c0000135
Mentioned dlls are in the same directory near the exe, but wine stubbornly doesn't see (or like) them.
Tried to remove my .wine - didn't help
What's going on ?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Wine can't find/load DLLs in the same dir

Post by jkfloris »

Start the application with:

Code: Select all

wine start sss.exe
# or
wine sss.exe
olpchk
Newbie
Newbie
Posts: 2
Joined: Thu Dec 23, 2021 11:38 am

Re: Wine can't find/load DLLs in the same dir

Post by olpchk »

jkfloris wrote: Sat Dec 25, 2021 9:52 am Start the application with:

Code: Select all

wine start sss.exe
# or
wine sss.exe
Same results
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Wine can't find/load DLLs in the same dir

Post by jkfloris »

Error c000012f means Wine can't load the DLL (nnn.dll) because the he required Microsoft Visual C++ Redistributables files can't be found or there is a 64 - 32 bit mismatch.
LateralShift
Level 2
Level 2
Posts: 27
Joined: Mon Nov 16, 2020 4:06 pm

Re: Wine can't find/load DLLs in the same dir

Post by LateralShift »

Have you tried adding a DLL override?

- run winecfg
- in the menu that appears select "Add application..." (Assuming it isn't already listed)
- Navigate to your executable and select it
- Click on the tab marked "Libraries"
- You should see a dropdown labeled "New override for library". If nnn.dll is a system DLL, you can select it from this. Otherwise explicity type it into the dropdown and click "Add"
- nnn.dll should now be in the list labeled "Existing overrides." Highlight it and click "Edit..."
- Set the radio menu to "Native, then Builtin"
- Click apply

This will tell WINE to use the DLL matching "nnn.dll" in WINEPREFIX/drive_c/windows/system32, or in the same directory as the exe if it exists there. So basically the same way Windows does it.
Locked