Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to compile cairo on macOS Sierra #183

Closed
andreabedini opened this issue Sep 28, 2016 · 8 comments
Closed

Failure to compile cairo on macOS Sierra #183

andreabedini opened this issue Sep 28, 2016 · 8 comments

Comments

@andreabedini
Copy link

andreabedini commented Sep 28, 2016

I'm a newbie so I am not familiar with the whole stack. But I have this problem.

$ stack build cairo
[1 of 2] Compiling SetupWrapper     ( SetupWrapper.hs, /private/var/folders/rn/5myk4cmd49n0js1s8jr5977w0000gn/T/stack35188/cairo-0.13.1.1/.stack-work/dist/x86_64-osx/Cabal-1.22.5.0/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /private/var/folders/rn/5myk4cmd49n0js1s8jr5977w0000gn/T/stack35188/cairo-0.13.1.1/Setup.hs, /private/var/folders/rn/5myk4cmd49n0js1s8jr5977w0000gn/T/stack35188/cairo-0.13.1.1/.stack-work/dist/x86_64-osx/Cabal-1.22.5.0/setup/Main.o )
Linking /private/var/folders/rn/5myk4cmd49n0js1s8jr5977w0000gn/T/stack35188/cairo-0.13.1.1/.stack-work/dist/x86_64-osx/Cabal-1.22.5.0/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring cairo-0.13.1.1...
Building cairo-0.13.1.1...
Preprocessing library cairo-0.13.1.1...
gtk2hsC2hs: Error in C header file.

/usr/include/stdio.h:133: (column 19) [FATAL] 
  >>> Syntax error!
  The symbol `_close' does not fit here.

line 133 of stdio.h is

typedef struct __sFILE {
        ... omiss ...
        int     (* _Nullable _close)(void *);
        ... omiss ...
} FILE;

apparently _Nullable is defined in /usr/include/sys/cdefs.h.

@loisch
Copy link

loisch commented Oct 9, 2016

I've got the same problem. Any ideas?

@loisch
Copy link

loisch commented Oct 9, 2016

I don't have macOS Sierra. I only installed XCode 8.

@loisch
Copy link

loisch commented Oct 12, 2016

I've found a workaround: I installed an old SDK from https://github.com/phracker/MacOSX-SDKs.

@timbod7
Copy link
Contributor

timbod7 commented Oct 29, 2016

@loisch How did you make the build process point to the old SDK?

@agrafix
Copy link

agrafix commented Oct 29, 2016

@timbod7 you download the SDK and then SymLink it. The only annoyance is that you will have to rebuild everything...

@agrafix
Copy link

agrafix commented Oct 29, 2016

Btw the bug is probably something related to:

-- parse C structure declaration (C99 6.7.2.1)

@hamishmack
Copy link
Contributor

Sorry for the delay fixing this. It turns out this error only happens when building from clean. Fixed version of cairo (cairo-0.13.3.1) is now in hackage. Just uploading fixes for the other Gtk2Hs packages now.

@timbod7
Copy link
Contributor

timbod7 commented Oct 30, 2016

@hamishmack Thanks for this. Switching to the new packages solved my issues with xcode 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants