Closed unhandyandy closed 3 years ago
Thanks for reporting. Seems you are the second person with this issue, see
https://github.com/StefanSalewski/gintro/issues/151
We never had that issue before in the last five years, and we have no idea about the reason still.
If you are new to Nim, I assume you are new to GTK as well: For that case I would recommend avoiding GTK. Learning GTK is hard, much more effort than learning Nim. There are 20 other GUI toolkits for Nim now available, I have listed them at the beginning of the GTK4 book, see http://ssalewski.de/gtkprogramming.html
Araq and some other Nim core devs seems to promote fidget currently. At least for toy apps most of the 20 toolkits should be fine.
Of course we would love to find the reason for your install issue. Are you using Debian too? It would be nice if you could later, when you have some more experience with Nim, try to debug the issue. The missing GTK4 should be not a problem, it worked in the last year for a lot of people without GTK4 fine. I got myself preinstalled GTK4 on my gentoo linux box some months ago for the first time. Tested without GTK4 before, all was fine.
Of course if you should think that you really need gintro for Nim for some reason, then we can try harder to debug the issue, or maybe we can send you the prebuild GTK modules. Would be not a perfect match for your box, but when you tell us if you are using Windows, Mac or linux, and if it is 32 or 64 bit, then it should work. But I really assume that you do not need and do not want GTK.
we have no idea
Ah wait -- I just noticed that your
/tmp/gintrosalewski/gen.nim(3768) main
may be a different line on my box, as I am using "nimble install gintro @head" while you and the other reporter may be using v0.9.3. So maybe I looked at the wrong line 3 weeks ago. Will investigate the v0.9.3 gen.nim file this evening, maybe I will get an idea...
I'm on Linux, Ubuntu 20, 64 bit, sorry I didn't mention that. I don't have much experience with Gtk, but I have successfully used it for a toy app in Julia.
Unfortunately I can currently not really help you. Assuming that you tried to install latest stable gintro v0.9.3 then the error seems to be at line 3768 which is
if gStructInfoFindMethod(info, n) != nil:
For me there the error position and the error message makes no sense.
Can you tell us which Nim compiler version you are using? Are you using some special options, maybe installed the compiler with ARC enabled or using clang?
I really wonder why this error is never occurred in the last 5 years before. For GTK4 I would be not that surprised, as GTK4 is in active development. But GTK3 should be really stable.
So I think we have to wait until this error will happen to someone with some Nim debugging experience. And follow my advice, use one of the other 20 GUI toolkits. GTK is hard -- I tried one hour to get a larger Icon for a GtkMenuButton in a GtkHeaderbar this morning, and still failed. May have to ask Mr Bassi again :-(
I'm using the latest Nim git pull, it shows the most recent tag as v1.4.8. No special options (I wouldn't know how).
Maybe a bug in gStructInfoFindMethod?
I'll check out fidget, thanks.
@unhandyandy Do you have the gobject-introspection package installed? https://packages.ubuntu.com/search?keywords=gobject-introspection (I assume that if julia worked, then it should, but it's still better to check)
Can you run this hello world python example?
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
I have successfully launched gintro on windows, so I am sure that this should be possible on ubuntu as well. https://github.com/gavr123456789/Katana#windows
I'm using the latest Nim git pull, it shows the most recent tag as v1.4.8. No special options (I wouldn't know how).
Maybe a bug in gStructInfoFindMethod?
I'll check out fidget, thanks.
@gavr123456789 I have gobject-introspection 1.56.1. That python script runs without error. The problem seems to be with the gintro install script.
I have gobject-introspection 1.56.1
Really? That is 3 years old. But well, gintro was working 3 years ago well. Unfortunately I have still no idea, the issue is very strange.
Really? That is 3 years old.
This is not surprising, do not forget that ubuntu and most other distributions are not rolling, and receive package updates every 6 months or 2 years for LTS versions.
OK, apparently the problem is my Ubuntu version, which is 18.04 LTS in my office.
I confused it with my home, where it is 20.10, actually now 21.04
It installs successfully under the latter. So the problem is at my end.
Thanks for your help.
@unhandyandy so can be closed?
It is not bad to leave it open, as other people with a corrupted Linux box may have a similar issue. Someone recently reported something similar. Unfortunately we do not know the exact reason for this error, seems to be somehow a broken gobject-introspection.
OK, seems that only very few people have this strange problem, so I think we can close this issue.
I'm brand new to Nim, so I probably doing something stupid, but I'm I get a segfault when I try to install gintro via nimble.
I have Gtk3, but not Gtk4.
Here's the tail end of the progress message.
Here's what I get when I run gen in the /tmp directory: