deech / fltkhs

Haskell bindings to FLTK GUI toolkit.
MIT License
190 stars 24 forks source link

Syntax error while installing with bundled fltkhs #169

Open chenyulue opened 3 years ago

chenyulue commented 3 years ago

I got the following error:

> fltkhs > make[1]: Leaving directory '/c/Users/chenyulue/AppData/Local/Temp/stack-bcc533c003cb80ea/fltkhs-0.8.0.3/.stack-work/dist/29cc6475/build/c-src' > fltkhs > Preprocessing library for fltkhs-0.8.0.3.. > fltkhs > c2hs.exe: C header contains errors: > fltkhs > > fltkhs > C:/Users/chenyulue/AppData/Local/Programs/stack/x86_64-windows/ghc-8.8.4/mingw/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h:836: (column 222) [ERROR] >>> Syntax error ! > fltkhs > The symbol `)' does not fit here. > fltkhs > > > Progress 1/2 > > -- While building package fltkhs-0.8.0.3 (scroll up to its section to see the error) using: > C:\Users\chenyulue\AppData\Local\Temp\stack-bcc533c003cb80ea\fltkhs-0.8.0.3\.stack-work\dist\29cc6475\setup\setup > > --builddir=.stack-work\dist\29cc6475 build --ghc-options " -fdiagnostics-color=always" > Process exited with code: ExitFailure 1

What's wrong with it? The command to build it is stack install --flag fltkhs:bundled --flag fltkhs:opengl in the fltkhs-hello-world directory on windows os.

However, if I run the command stack install --flag fltkhs:bundled, the package is installed successfully. So what's wrong with opengl? What else should I do if I want to build it with the flag fltkhs:opengl?

mtolly commented 3 years ago

This is a fix that needs to be made in language-c for c2hs, there's an odd construction in the MinGW header that only gets exposed if compiling with the OpenGL option.

Issue - https://github.com/visq/language-c/issues/83 PR - https://github.com/visq/language-c/pull/84

You can add my patch for now with the following in stack.yaml:

extra-deps:
- git: git://github.com/mtolly/language-c
  commit: 5e40d962fb71b7e1256ff607194c53544709e761