-
Notifications
You must be signed in to change notification settings - Fork 72
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
GTK4 - Windows - Linking problems - GHC 9.0.2 and GHC 9.2.3 #384
Comments
Thanks for the report! From reading the bug reports you link to I think I see why the issue arose, but I don't quite see how to work around this in gi-gtk itself. Just for curiosity, does the workaround mentioned in https://gitlab.haskell.org/ghc/ghc/-/issues/21111#note_418314 fix things for you? I don't have easy access to a Windows machine at the moment, but I should get one in a week or two, so I can try to take a more careful look then. But if in the interim you have any suggestions for workarounds that we could add in gi-gtk / haskell-gi I would be happy to do so! |
I suspect there is no fix in |
I did have success with GTK4 on Windows 11 with Stack and GHC-9.4.1-alpha3 (which comes with I used There is no Stackage resolver yet for GHC 9.4.1 (it is in alpha). So, I created a ghc:
windows64:
9.4.1:
url: "https://downloads.haskell.org/ghc/9.4.1-alpha3/ghc-9.4.0.20220623-x86_64-unknown-mingw32.tar.xz"
content-length: 281104480
sevenzexe-info:
url: "https://github.com/fpco/minghc/blob/master/bin/7z.exe?raw=true"
content-length: 73728
sha1: 187dff8a3327da87050f678579816e5bae40c632
sevenzdll-info:
url: "https://github.com/fpco/minghc/blob/master/bin/7z.dll?raw=true"
content-length: 447488
sha1: 168a288d4456f0473f66e86a2d6fec4eb6f4b993 I then used the I used the following name: gtkTest
version: 0.1.0.0
dependencies:
- base >= 4.17 && < 5
- gi-gtk >= 4
- haskell-gi-base
- vector < 0.13
executables:
gtkTest:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N I used the following resolver: ghc-9.4.1
packages:
- .
allow-newer: true
extra-deps:
- ansi-terminal-0.11.3
- async-2.2.4
- attoparsec-0.14.4
- blaze-builder-0.4.2.2
- blaze-html-0.9.1.2
- blaze-markup-0.8.2.8
- cabal-doctest-1.0.9
- colour-2.3.6
- conduit-1.3.4.2
- conduit-extra-1.3.6
- data-default-class-0.1.2.0
- gi-atk-2.0.24
- gi-cairo-1.0.26
- gi-freetype2-2.0.1
- gi-gdk-4.0.4
- gi-gdkpixbuf-2.0.28
- gi-gio-2.0.29
- gi-glib-2.0.26
- gi-gmodule-2.0.2
- gi-gobject-2.0.27
- gi-graphene-1.0.4
- gi-gsk-4.0.4
- gi-gtk-4.0.5
- gi-harfbuzz-0.0.6
- gi-pango-1.0.26
- happy-1.20.0
- hashable-1.4.0.2
- haskell-gi-0.26.0
- haskell-gi-base-0.26.0
- haskell-gi-overloading-1.0
- haskell-lexer-1.1
- integer-logarithms-1.0.3.1
- mintty-0.1.4
- mono-traversable-1.0.15.3
- network-3.1.2.7
- pretty-show-1.10
- primitive-0.7.4.0
- random-1.2.1.1
- regex-base-0.94.0.2
- regex-tdfa-1.3.1.3
- resourcet-1.2.6
- safe-0.3.19
- scientific-0.3.7.0
- split-0.2.3.4
- splitmix-0.1.0.4
- streaming-commons-0.2.2.4
- typed-process-0.2.10.1
- unliftio-core-0.2.0.1
- unordered-containers-0.2.19.1
- vector-0.12.3.1
- vector-algorithms-0.8.0.4
- vector-stream-0.1.0.0
- xdg-basedir-0.2.2
- xml-conduit-1.9.1.1
- xml-types-0.3.8
- zlib-0.6.3.0 This was my source code in {-# LANGUAGE LexicalNegation #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
import Data.GI.Base (AttrOp ((:=)), new, on, set)
import qualified GI.Gtk as Gtk
import Control.Monad (void)
main :: IO ()
main = do
app <- new Gtk.Application []
on app #activate (activate app)
void $ #run app Nothing
activate :: Gtk.Application -> IO ()
activate app = do
win <- new Gtk.Window [ #title := "Hi there" ]
button <- new Gtk.Button [ #label := "Click me" ]
on button #clicked (set button [ #sensitive := False,
#label := "Thanks for clicking me" ])
#setChild win (Just button)
#setDefaultSize win 400 -1
#show win
#addWindow app win I then commanded
For some reason
resulted in the |
I think that due to a bug in GHC affecting at least GHC 9.0.2 and GHC 9.2.3 - see https://gitlab.haskell.org/ghc/ghc/-/issues/21111 - GTK4 does not work with
gi-gtk
on Windows. I think that is because [1]mingw-w64-x86_64-gtk4
(unlikegtk3
) requiresmingw-w64-x86_64-crt-git-10.0.0.r32.g89bacd2be-1
, as a dependency offfmpeg
\frei0r-plugins
\opencv
\ogre3d
\winpthreads
and [2] GHC cannot cope with a change in symbols used by that MSYS2 package.Building results in errors like:
The text was updated successfully, but these errors were encountered: