lettier / webviewhs

🌐 A Haskell binding to the webview library created by Serge Zaitsev.
https://lettier.github.io/webviewhs
BSD 3-Clause "New" or "Revised" License
125 stars 8 forks source link

Can't install library #10

Closed ryuhhnn closed 4 years ago

ryuhhnn commented 4 years ago

I'm trying to just get a basic example of using this package. I followed the instructions after doing a stack new project_name. I then edited the project_name.cabal file along with the stack.yaml file as the instructions asked and did a stack install --only-dependencies. I'm now getting the following error when I try to do a stack build:

ghcide compiled by GHC 8.8 failed to load packages: <command line>: cannot satisfy -package webviewhs-0.1.0.0
    (use -v for more information). 
Please ensure that ghcide is compiled with the same GHC installation as the project.cradle

I'm also getting a whole slew of different errors when running install:

webviewhs> Building library for webviewhs-0.0.2.0..
webviewhs> [1 of 1] Compiling Graphics.UI.Webviewhs
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0/In file included from src/c/webview-ffi.c:9:0: error:
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0/deps/webview/webview.h:1709:23: error:
webviewhs>      error: too many arguments to function call, expected 0, have 3
webviewhs>       return objc_msgSend((id)objc_getClass("NSString"),
webviewhs>              ~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webviewhs>      |
webviewhs> 1709 |   return objc_msgSend((id)objc_getClass("NSString"),
webviewhs>      |                       ^
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/message.h:62:1: error:
webviewhs>      note: 'objc_msgSend' declared here
webviewhs>    |
webviewhs> 62 | OBJC_EXPORT void
webviewhs>    | ^
webviewhs> OBJC_EXPORT void
webviewhs> ^
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc-api.h:236:25: error:
webviewhs>      note: expanded from macro 'OBJC_EXPORT'
webviewhs>     |
webviewhs> 236 | #   define OBJC_EXPORT  OBJC_EXTERN OBJC_VISIBLE
webviewhs>     |                         ^
webviewhs> #   define OBJC_EXPORT  OBJC_EXTERN OBJC_VISIBLE
webviewhs>                         ^
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc-api.h:225:28: error:
webviewhs>      note: expanded from macro 'OBJC_EXTERN'
webviewhs>     |
webviewhs> 225 | #       define OBJC_EXTERN extern
webviewhs>     |                            ^
webviewhs> #       define OBJC_EXTERN extern
webviewhs>                            ^
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0/In file included from src/c/webview-ffi.c:9:0: error:
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0/deps/webview/webview.h:1715:20: error:
webviewhs>      error: too many arguments to function call, expected 0, have 2
webviewhs>           objc_msgSend((id)objc_getClass("NSMenuItem"), sel_registerName("alloc"));
webviewhs>           ~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webviewhs>      |
webviewhs> 1715 |       objc_msgSend((id)objc_getClass("NSMenuItem"), sel_registerName("alloc"));
webviewhs>      |                    ^
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/message.h:62:1: error:
webviewhs>      note: 'objc_msgSend' declared here
webviewhs>    |
webviewhs> 62 | OBJC_EXPORT void
webviewhs>    | ^
webviewhs> OBJC_EXPORT void
webviewhs> ^
webviewhs>
webviewhs> /private/var/folders/ry/tp8rmkss4pq79qr29j1hkbrj3v_s32/T/stack-31a40dd09d22141b/webviewhs-0.0.2.0//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc-api.h:236:25: error:
webviewhs>      note: expanded from macro 'OBJC_EXPORT'
webviewhs>     |
webviewhs> 236 | #   define OBJC_EXPORT  OBJC_EXTERN OBJC_VISIBLE
webviewhs>     |                         ^
webviewhs> #   define OBJC_EXPORT  OBJC_EXTERN OBJC_VISIBLE

I'm kind of new to Haskell so I'm not sure if this is an issue with the library or an issue with my setup.

ryuhhnn commented 4 years ago

My apologies, this looks like a duplicate of #7