Skip to content
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

Error when trying to compile the example. #9

Closed
JonnyCodewalker opened this issue Mar 11, 2018 · 8 comments
Closed

Error when trying to compile the example. #9

JonnyCodewalker opened this issue Mar 11, 2018 · 8 comments

Comments

@JonnyCodewalker
Copy link

When trying to compile the example i get the following error:

Error in src/test.cr:2: while requiring "qt5"
require "qt5" # Require it!
^
in lib/qt5/src/qt5.cr:5: while requiring "./qt5/binding"
require "./qt5/binding"
^
in lib/qt5/src/qt5/binding.cr:6: expanding macro
{% begin %}
^
in lib/qt5/src/qt5/binding.cr:7: Error executing run (exit code: 1): /home/jonathan/Documents/Crystal/test/lib/qt5/src/qt5/../../support/decide_binding_fast.cr 
stdout:

stderr:
    Error in support/decide_binding_slow.cr:1: while requiring "bindgen/library"
    require "bindgen/library"
    ^
    in lib/bindgen/src/bindgen/library.cr:11: while requiring "./*"
    require "./*"
    ^
    in lib/bindgen/src/bindgen/find_path.cr:2: Good news: Crystal#5445 is fixed, see this file!
    require "./find_path/*"
    ^
    Support script decide_binding_slow.cr failed (Exception)
      from ???
      from __crystal_main
      from main
      from __libc_start_main
      from ../sysdeps/x86_64/start.S:122:0 in '_start'
      from ???
  {% use_binding = run("#{__DIR__}/../../support/decide_binding_fast.cr") %}
                   ^~~

@Papierkorb
Copy link
Owner

Nice, that's now fixed in 0.24.2. You tripped a trip-wire in bindgen checking for this condition.

Update the dependencies in your qt5.cr and try again.

@JonnyCodewalker
Copy link
Author

Ok, either I found another trip-wire or it is something with my system.


 crystal run src/test.cr
cc: error: /home/jonathan/Documents/Crystal/test/lib/qt5/src/qt5/binding/../../../ext/binding_linux-gnu-x86_64-qt5.10.a: No such file or directory
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/jonathan/.cache/crystal/crystal-run-test.tmp'  -rdynamic  /home/jonathan/Documents/Crystal/test/lib/qt5/src/qt5/binding/../../../ext/binding_linux-gnu-x86_64-qt5.10.a -lstdc++ -lQt5Core -lQt5Gui -lQt5Widgets -lpcre -lgc -lpthread /opt/crystal-0.24.2/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

@Papierkorb
Copy link
Owner

You're not using the master-ready-to-go branch which you should if you don't want to generate the bindings yourself.

@JonnyCodewalker
Copy link
Author

screenshot from 2018-03-11 22-09-39
If it helps, I am on Solus.

@ctxcode
Copy link

ctxcode commented Mar 13, 2018

Hello there,

I had the exact same error. I'm really a beginner at compiled languages. (first day actually). It's looking for a file named "binding_linux-gnu-x86_64-qt5.10.a" , but there is no such file in the "master-ready-to-go" branch. So i tried compiling it myself and it worked. I can now run my program.

What i did:

sudo apt-get install libgc-dev
cd lib/qt5/ext/
make

I had some trouble with "make", so i changed the Makefile

CXXFLAGS := -Wall -Werror -Wno-unused-function -fPIC -fno-rtti -I/usr/include/x86_64-linux-gnu/qt5 -I.
CPPFILES := qt_binding_linux-gnu-x86_64-qt5.10.cpp
OBJFILES := $(CPPFILES:.cpp=.o)
LIBFILE  := binding_linux-gnu-x86_64-qt5.10.a

CC = g++
AR ?= ar
RM ?= rm

Also, i have qt5.5, i changed it to 5.10 in the text above just not to confuse you. But maybe you'll run into different errors then me.

Sidenote: Sorry if what i'm doing is completely wrong. I have no idea how compiled languages work :)

@Papierkorb
Copy link
Owner

Please don't modify files, the process on how to generate the bindings manually is outlined in the README. (May not have been when you were doing that yet)

Also, that file exists in https://github.com/Papierkorb/qt5.cr/tree/master-ready-to-use/src/qt5/binding

@ctxcode
Copy link

ctxcode commented Mar 13, 2018

I removed all my files and reinstalled the package. Now everything worked from the start. I think it's because i didn't have libgc-dev installed last time. And you need it to compile those bindings.

@docelic
Copy link
Collaborator

docelic commented May 26, 2020

Closing this ticket as the comments on it seem to indicate that the issue has been fixed a while ago.
Please reopen if it persists.

@docelic docelic closed this as completed May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants