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] Linux/gtk3 undeclared identifier: 'Rectangle #62

Open
nodrygo opened this issue Jan 25, 2020 · 9 comments
Open

[error] Linux/gtk3 undeclared identifier: 'Rectangle #62

nodrygo opened this issue Jan 25, 2020 · 9 comments

Comments

@nodrygo
Copy link

nodrygo commented Jan 25, 2020

Hello
I wanted to test gintro who seem really good but can't make demo on my Linux Mint19 see below
do you have some idea ?
thank's for your help and this lib

tested on Nim 1.0.4 and lastest Nim1.1.1
last git gintro
nim c -r label.nim
gintro-0.6.1/gintro/cairoimpl.nim(646, 22) Error: undeclared identifier: 'Rectangle

same error occur with makeAll (last line)

Hint: used config file '/home/ygo/dev/nim/nim-1.0.4/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: celldatafunction [Processing]
Hint: gtk [Processing]
Hint: pango [Processing]
Hint: cairo [Processing]
Hint: gobject [Processing]
Hint: glib [Processing]
Hint: times [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: bitops [Processing]
Hint: macros [Processing]
Hint: algorithm [Processing]
Hint: unicode [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
Hint: posix [Processing]
~/.nimble/pkgs/gintro-0.6.1/gintro/cairoimpl.nim(646, 22) Error: undeclared identifier: 'Rectangle

by the way during nimble install got this error

** (process:6918): CRITICAL **: 19:51:00.465: g_irepository_get_shared_library: assertion 'typelib != NULL' failed
@StefanSalewski
Copy link
Owner

Oh, seems to be again

#60

I have intentionally not closed that one, but its author closed it.

If you live in the free world, then try to get a recent gtk version. If you are from China, then I can currently not really help you, sorry. Tomorrow I will ship version 0.7 with ARC support!

@StefanSalewski
Copy link
Owner

The other typelib error I will investigate tomorow in more detail...

@StefanSalewski
Copy link
Owner

I hope you have fixed your issue by using a recent gtk version now or by following #issue60 and the related forum posts. Your gtk must be really old, older than one year at least.

For the typelib issue I would have tow guesses: Maybe your gtk is so old that there is no cairo support at all. Or maybe you have no gtksourceview support by default -- some distros have separate dev packages for gtksourceview. It would be hard for me to examine this in detail.

Note that I do not really recommend gintro for all users. There are many other GUI packages now, see nimble search gui and https://github.com/nim-lang/Nim/wiki/Curated-Packages

@nodrygo
Copy link
Author

nodrygo commented Jan 27, 2020

hello
thanks for your answer
I am on the gtk 3.22.30 provided by Mint 19.1
I have tested some other package but no one is as finished as gtk is ;-) except probably niup but some other problems here also with libm and libgc
I am not using it professionally so no problem using gintro
thanks again for this library (but gtk 3.24 seem not well finished so I will continue my personal coding with Go/gotk3)

@define-private-public
Copy link

Hi, this is happening for me as well right now too.

@StefanSalewski
Copy link
Owner

Well, and the solution is still obviously: Use a recent GTK, not one much older than a year.

I would care for this problem if there would be many complaints from china or poor african states, but I think all came from the free and rich world, where a recent GTK should be available.

Other solutions have been described, one was removing the include statement in cairo.nim, the other using an older gintro version.

@nodrygo
Copy link
Author

nodrygo commented Apr 12, 2020

unfortunately the latest version is not necessarily the official version for some distributions. Ubuntu have preferred some back-port for stability reasons

I found a simple solution, just adding these lines (from line 108) in

gintro / cairoimpl.nim

may be not a good solution but this works very well for me (I had same problem and bring same solution for Crystal Lang, unfortunately Crystal doesn't work on Windows )

type
     Rectangle = ref object of RootObj
         x: float64
         y: float64
         width: float64
         height: float64

@StefanSalewski
Copy link
Owner

I would have assumed that much more than just Rectangle type is missing. But maybe the other missing data types are not needed directly. Fine that it works for you.

The reason for the problem is, that cairo is not really supported by gobject-introspection. In old GTK it was nearly unsupported, but in newer GTK at least the elementary data types are provided. Initially I had created the whole cairo module manually by c2nim, now I take the types provided by gobject-introspection from there.

@nodrygo
Copy link
Author

nodrygo commented Apr 12, 2020 via email

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

3 participants