28

My wine met some problems while executing Windows executable file:

$ wine GECacheBldr.exe
zsh: bad CPU type in executable: wine

How to fix this?

PS: My wine is installed using HomeBrew:

$ brew cask install wine-stable

EDIT

Cannot execute winecfg either:

$ winecfg
/usr/local/bin/winecfg: line 46: /usr/local/bin/wine: Bad CPU type in executable
/usr/local/bin/winecfg: line 46: /usr/local/bin/wine: Undefined error: 0
Spiff
  • 101,729
  • 17
  • 175
  • 229
xiaoyu2006
  • 382
  • 1
  • 3
  • 7

4 Answers4

56

Try

file `which wine`

If it says something in the lines of Mach-O executable i386: Apple dropped support for 32bit executables with Catalina 10.15.

You might want to try wine64 instead of wine.

jvb
  • 3,065
  • 1
  • 16
  • 18
  • How to run a 32-bit Windows executable file? Or I can never use them? – xiaoyu2006 Feb 06 '20 at 12:06
  • 2
    Alas, not with `wine` on Catalina 10.15 any more. You could use a virtual machine (like VirtualBox - it's free), but then you would need a Windows license, and have to install Windows inside the VM. – jvb Feb 06 '20 at 12:42
  • 1
    I don't think this accepted solution actually solves the problem. – Dr_Zaszuś Apr 03 '20 at 18:47
  • 3
    @Dr_Zaszuś there is no solution insofar one cannot use 32bit software on MacOS Catalina. Either use 64bit wine or downgrade MacOS, or try a different approach (like VirtualBox), see above. – jvb Apr 03 '20 at 19:31
  • Is there a reason that the Wine devs don't just make the `wine` command launch 64-bit Wine? – Aaron Franke Mar 11 '22 at 06:07
  • @AaronFranke In my opinion, not really. I guess the developers could (a) replace `wine` with a shell script (to launch either wine32 or wine64 depending on `arch`), (b) create a symlink at install time, or even (c) make it an [universal binary](https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary). Perhaps someone will do that one day. – jvb Mar 11 '22 at 10:03
2

I did

rm /usr/local/bin/wine

then

ln -s /usr/local/bin/wine64 /usr/local/bin/wine

because "wine" is the 32bit version which is tried first by all scripts and apparently OS X does not provide a compatibility layer for 32bit.

It basically works but so far I wasn't able to do everything I need, I still got errors when executing some wine related commands.

Another options I tried with more success in prepending WINE=/usr/local/bin/wine64 before every wine related commands I want to run, including winetricks

sonatique
  • 121
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 28 '22 at 10:10
1

Been having the same issue, for 13.4.1 Ventura.

The answer from Иван Балдин should have worked but they added a second line.

if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi
...
if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi

Comment out these 2 lines and winecfg should work.

0

try to edit winecfg file, comment this line

if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi

it should look like that

#if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 27 '22 at 02:51