The Crystal Programming Language Forum

Crystal Qt5 undefined method

Hello, today I tried to use the Qt5 library with crystal, I followed the instruction, but when I tried to run the example from the website, this don’t work, I have this strange error:

~/Documents/Programmation/Pokémon ❯❯❯ crystal build 
Showing last frame. Use --error-trace for full trace.

In lib/qt5/src/qt5/

 7 | {% use_binding = run("#{__DIR__}/../../support/") %}
Error: Error executing run (exit code: 1): '/home/zohran/Documents/Programmation/Pokémon/lib/qt5/src/qt5/../../support/' 




    Showing last frame. Use --error-trace for full trace.
    In support/
     7 | YAML.mapping(find_paths: Bindgen::FindPath::Configuration)
    Error: undefined method 'mapping' for YAML:Module
    Unhandled exception: Support script failed (Exception)
      from ???
      from ???
      from __crystal_main
      from main
      from __libc_start_main
      from _start
      from ???

This is my

require "qt5"

qApp =

label = "Hello from Crystal/Qt!"


The Qt5 github compatibility for Crystal: GitHub - Papierkorb/ Qt5 bindings for Crystal, based on Bindgen

The gist of it is that that shard is old and currently doesn’t support Crystal 1.x.

There’s currently a PR for it: Crystal 1.0.0 by kalinon · Pull Request #46 · Papierkorb/ · GitHub.