Getting an error when trying to install wine using brew. Made sure I ran brew update and brew upgrade. Tried installing libpng on it's own as well, but still getting same error.

Just installed Xcode, and made sure I accepted the terms.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/libpng-20161205-66702-a4brfd/libpng-1.6.26':
configure: error: C compiler cannot create executables
See `config.log' for more details

Edit: Adding versions.

Mac OS X 10.11.6

Xcode: 8.1

Another edit: Looking through the gist of the error, I think this might be the culprit.

configure:3291: checking whether the C compiler works
configure:3313: clang    conftest.c  >&5
ld: unexpected token: !tapi-tbd-v2 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3317: $? = 1
configure:3355: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libpng"
| #define PACKAGE_TARNAME "libpng"
| #define PACKAGE_VERSION "1.6.26"
| #define PACKAGE_STRING "libpng 1.6.26"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define PACKAGE "libpng"
| #define VERSION "1.6.26"
| /* end confdefs.h.  */
| int
| main ()
| {
|   ;
|   return 0;
| }
configure:3360: error: in `/private/tmp/libpng-20161205-66702-a4brfd/libpng-1.6.26':
configure:3362: error: C compiler cannot create executables
See `config.log' for more details

Edit: Adding gist logs. https://gist.github.com/codephobia/98b8c8e5954c7d324384c49c6ebd99dc

Edit: I was able to get it working by cloning the repo and building it from the source code. I am going to leave this question open, since I would prefer to install it with brew to make updating easier.

  • Is xquartz operational as well?
    – bmike
    Commented Dec 6, 2016 at 0:36
  • I installed both java and xquartz with the following command brew cask install java xquartz. Unsure how to test if it is working though.
    – codephobia
    Commented Dec 6, 2016 at 0:43
  • Is wine actually compatible with OS X?
    – voices
    Commented Dec 6, 2016 at 21:18
  • You might like to use Wineskin Winery instead: brew cask install wineskin-winery
    – Jivan Pal
    Commented Nov 16, 2019 at 18:54

1 Answer 1


Good work with the detailed error message. I would try to install just libpng with brew install libpng and then if that fails brew update && brew update && brew doctor just to check out common issues. ( I know you said you tried this - but it's not clear that you succeeded with that try)

The above recommendation is from https://github.com/Homebrew/brew/blob/master/docs/README.md#readme

That links to the Troubleshooting Checklist for if you find one package that fails you (looks like libpng from your logs so far).

run brew gist-logs <formula> (where <formula> is the name of the formula that fails you).

  • Yeah I tried the double brew update, and brew doctor only showed node not being linked which I have fixed. brew install libpng installed, but I still get the same error when installing wine. I get the same error when running brew install libpng --universal that I get when installing wine.
    – codephobia
    Commented Dec 6, 2016 at 0:39
  • 2
    @codephobia - well - you've ruled out the easy things. Maybe open a case at homebrew and link to the gist. Perhaps some more eyes on the entire details might help spot something you missed? My guess is you have a legitimate build error that will need some sort of code fix.
    – bmike
    Commented Dec 6, 2016 at 1:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .