Papierkorb / qt5.cr

Qt5 bindings for Crystal, based on Bindgen
Mozilla Public License 2.0
211 stars 20 forks source link

Error compiling hello world. #23

Closed hugopl closed 4 years ago

hugopl commented 4 years ago

Using shards.yml with:

dependencies:
  qt5:
    github: Papierkorb/qt5.cr
    branch: master-ready-to-use

and https://raw.githubusercontent.com/Papierkorb/qt5.cr/master/samples/hello_world.cr with require "qt5" instead of require "../src/qt5".

I got this on shards build:

$ shards build --error-trace
Dependencies are satisfied
Building: crystalqt
Error target crystalqt failed to compile:
In src/crystalqt.cr:1:1

 1 | require "qt5"
     ^
Error: while requiring "qt5"

In lib/qt5/src/qt5.cr:5:1

 5 | require "./qt5/binding"
     ^
Error: while requiring "./qt5/binding"

In lib/qt5/src/qt5/binding.cr:6:1

 6 | {% begin %}
     ^
Error: expanding macro

There was a problem expanding macro 'macro_139658193954784'

Called macro defined in lib/qt5/src/qt5/binding.cr:6:1

 6 | {% begin %}

Which expanded to:

 > 1 | 
 > 2 |   
 > 3 |   require "./binding/binding_linux-gnu-x86_64-qt5.13"
Error: can't find file './binding/binding_linux-gnu-x86_64-qt5.13' relative to '/tmp/crystalqt/lib/qt5/src/qt5'

Tested with:

Crystal 0.31.1 (2019-10-21)

LLVM: 9.0.0
Default target: x86_64-pc-linux-gnu

on ArchLinux.

docelic commented 4 years ago

@hugopl this means that file src/qt5/binding/binding_linux-gnu-x86_64-qt5.13.cr did not exist in the qt5 project, which is in lib/qt5/. I am going to close this ticket as I've tested just now and believe it would work if/when the files for the platform you want to use it for exist in the ready-to-use branch.

If the problem persists, please add further comments to this ticket, including the output of:

cd lib/qt5
ls -al src/qt5/binding ext/