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

Linking fails on Windows when trying to install via nimble #33

Open
define-private-public opened this issue Jan 10, 2019 · 11 comments
Open

Comments

@define-private-public
Copy link

Hint:  [Link]
Hint: operation successful (48056 lines compiled; 1.015 sec total; 92.957MiB peakmem; Debug Build) [SuccessX]
could not load: libgirepository-1.0.dll
stack trace: (most recent call last)
C:\msys64\tmp\nimble_8180\githubcom_stefansalewskigintro\gintro.nimble(74) installBefore
C:\msys64\tmp\nimble_8180\githubcom_stefansalewskigintro\gintro.nimble(62) prep
C:\msys64\home\Benjamin\.bin\nim\lib\system\nimscript.nim(237) exec
C:\msys64\home\Benjamin\.bin\nim\lib\system\nimscript.nim(237, 7) Error: unhandled exception: FAILED: C:\msys64\tmp\gintrosalewski\gen

I installed nim 0.9.12 from source in an MSYS2 environment, and I have the necessary packages that the README told me to install. But I'm getting this error when I try to run nimble install gintro.

@StefanSalewski
Copy link
Owner

Hello, thanks for testing gintro module.

From message

could not load: libgirepository-1.0.dll

I assume that it is an Microsoft related issue. So it is not easy to debug for me, as I am using Linux only.

Do you really intend to use gintro seriously, or did you try to install just for fun? In the former case I would have to do further investigations, and I am willing to do that. But in the other case, which I assume is much more likely, we should just ignore the issue for now. As you know GTK is not very popular, especially for Windows users, so you may try one of the other Nim GUI libs.

Maybe one additional remark: I just remembered a report of another Windows User one year ago, see

#24

He wrote:

install msys2 and run: pacman -S mingw-w64-x86_64-gtk3 then run: pacman -S mingw-w64-x86_64-python3-gobject to get the other required dlls's.

That seems to solve it for him, but of course I do not know if you are using pacman for your Windows. I thing he got an additional issue with GTKSourceView, an optional package, which generally just can be ignored, but I am not sure if my install script ignores it gracefully currently.

@alaviss
Copy link

alaviss commented Jan 10, 2019

msys2 libgirepository dll is called: libgirepository-1.0-1.dll and not libgirepository-1.0.dll. Correcting the dll name in oldgtk3 should fix it IIRC

@StefanSalewski
Copy link
Owner

Great info, thanks. Is that new name valid for latest Windows 10 only, or for older releases too. I will try to fix that name soon, thanks.

@define-private-public
Copy link
Author

Hi. At the moment, I'm not doing anything serious/professional with Nim at the moment. Qt really is my preferred cross platform GUI toolkit, but making it work with Nim is kind of round-about at the moment. So I think that Gtk is the next best thing. I good cross-platform GUI I think it something that Nim really is lacking (I know about nimx and NiGui, but I don't think that they're quite there yet).

I'd be willing to help out with testing things on Windows in the meantime for you though.

@StefanSalewski
Copy link
Owner

I'd be willing to help out with testing things on Windows in the meantime for you though.

Yes that would be nice. Maybe for a first step you can search on your computer for libgirepository dll to investigate if it is totally missing or if as alaviss wrote only name was wrong.

Generally, GTK is ok for people already familiar with it and with mainly Linux as target audience. Windows users generally do not like GTK, some are even unable to install it. And learning GTK now from the beginning is hard, as there is only API documentation, but no good books, only minimal tutorial and nearly no community.

@define-private-public
Copy link
Author

The name of the DLL on my machine is as @alaviss reports it is. Can you update that code and I'll installing gintro again?

@StefanSalewski
Copy link
Owner

Should be fixed. Fix is in package oldgtk3 which is used for installation of gintro package.

$ diff gir.nim ~/.nimble/pkgs/oldgtk3-0.1.0/oldgtk3/gir.nim 
7c7
<   const LIB_GIR = "libgirepository-1.0-1.dll"
---
>   const LIB_GIR = "libgirepository-1.0.dll"

A fresh install of gintro should now use the correct dll name.

Unfortunately I just discovered that gintro does not work with latest Nim devel compiler, see

https://github.com/nim-lang/Nim/issues/10296

@define-private-public
Copy link
Author

Tested with Nim v0.19.2, works like a charm right now.

During installation of gintro, I did have this output:

Hint: used config file 'C:\msys64\home\Benjamin\.bin\
Hint: system [Processing]
Hint: gen [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: bitops [Processing]
Hint: algorithm [Processing]
Hint: unicode [Processing]
Hint: times [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
Hint: strformat [Processing]
Hint: macros [Processing]
Hint: winlean [Processing]
Hint: dynlib [Processing]
Hint: ospaths [Processing]
Hint: gir [Processing]
Hint: glib [Processing]
Hint: gobject [Processing]
Hint: sequtils [Processing]
Hint: streams [Processing]
Hint: sets [Processing]
Hint: hashes [Processing]
Hint: tables [Processing]
Hint: combinatorics [Processing]
CC: gir
Hint:  [Link]
Hint: operation successful (48056 lines compiled; 4.2
Remaining delayed methods: 0
Remaining delayed methods: 0
Caution: No free/unref found for  ScaledFont (pango_c
Caution: No free/unref found for  ScaledFont (pango_c
Remaining delayed methods: 0
Remaining delayed methods: 0
Remaining delayed methods: 0
Caution: No free/unref found for   (g_value_array_new
Caution: No free/unref found for   (g_value_array_new
Caution: No free/unref found for  ValueArray (g_valueray_copy)
Caution: No free/unref found for   (g_closure_new_obj)
Caution: No free/unref found for   (g_closure_new_obj)
Caution: No free/unref found for   (g_enum_complete_t_info)
Caution: No free/unref found for   (g_flags_complete_e_info)
Remaining delayed methods: 0
Remaining delayed methods: 0
Remaining delayed methods: 0
Remaining delayed methods: 0
Remaining delayed methods: 0
Caution: No free/unref found for  Language (pango_scr_get_sample_language)
Caution: No free/unref found for  Language (pango_scr_get_sample_language)
Caution: No free/unref found for  Language (pango_cont_get_language)
Caution: No free/unref found for  Language (pango_cont_get_language)
Remaining delayed methods: 0
Remaining delayed methods: 0
Remaining delayed methods: 0
Caution: No free/unref found for  Surface (gdk_windoweate_similar_image_surface)
Caution: No free/unref found for  Surface (gdk_windoweate_similar_surface)
Caution: No free/unref found for  Region (gdk_window__clip_region)
Caution: No free/unref found for  Region (gdk_window__clip_region)
Caution: No free/unref found for  Region (gdk_window__update_area)
Caution: No free/unref found for  Region (gdk_window__update_area)
Caution: No free/unref found for  Region (gdk_window__visible_region)
Caution: No free/unref found for  Region (gdk_window__visible_region)
Caution: No free/unref found for  Region (gdk_drawingntext_get_clip)
Caution: No free/unref found for  Region (gdk_drawingntext_get_clip)
Caution: No free/unref found for  Surface (gdk_cursort_surface)
Caution: No free/unref found for  Surface (gdk_cursort_surface)
Caution: No free/unref found for  Context (gdk_cairo_ate)
Caution: No free/unref found for  Region (gdk_cairo_ron_create_from_surface)
Caution: No free/unref found for  Surface (gdk_cairo_face_create_from_pixbuf)
Remaining delayed methods: 0
Caution: No free/unref found for  Region (gtk_widget_ion_intersect)
Caution: No free/unref found for  Surface (gtk_icon_srender_icon_surface)
Caution: No free/unref found for  Language (gtk_text_r_get_language)
Caution: No free/unref found for  Language (gtk_text_r_get_language)
Caution: No free/unref found for  Surface (gtk_tree_v_create_row_drag_icon)
Caution: No free/unref found for  Surface (gtk_icon_v_create_drag_icon)
Caution: No free/unref found for  EventSequence (gtk_ture_single_get_current_sequence)
Caution: No free/unref found for  EventSequence (gtk_ture_single_get_current_sequence)
Caution: No free/unref found for   (gtk_gradient_reso)
Caution: No free/unref found for  Pattern (gtk_gradieresolve_for_context)
Caution: No free/unref found for  Surface (gtk_icon_i_load_surface)
Caution: No free/unref found for  Surface (gtk_icon_te_load_surface)
Remaining delayed methods: 0
Typelib file for namespace 'GtkSource' (any version)  found
Maybe for your OS you have to install additional GTK ated packages?
We continue with the remaining packages...
Typelib file for namespace 'Vte' (any version) not fo
Maybe for your OS you have to install additional GTK ated packages?
We continue with the remaining packages...
  Verifying dependencies for [email protected]
 Installing [email protected]
   Success: gintro installed successfully.

It didn't seem to negatively effect anything I tried to run.

When compiling the examples, I'd get some deprecation warnings:

C:\Users\Benjamin\.nimble\pkgs\gintro-0.4.7\gintro\gimpl.nim(86, 24) Warning: sprecated [Deprecated]
C:\Users\Benjamin\.nimble\pkgs\gintro-0.4.7\gintro\gimpl.nim(86, 31) Warning: u: NimNode -> NimNode` instead; getImpl is deprecated [Deprecated]
C:\Users\Benjamin\.nimble\pkgs\gintro-0.4.7\gintro\gimpl.nim(88, 69) Warning: sprecated [Deprecated]
C:\Users\Benjamin\.nimble\pkgs\gintro-0.4.7\gintro\gimpl.nim(88, 76) Warning: u: NimNode -> NimNode` instead; getImpl is deprecated [Deprecated]
C:\Users\Benjamin\.nimble\pkgs\gintro-0.4.7\gintro\gimpl.nim(88, 107) Warning: eprecated [Deprecated]
C:\Users\Benjamin\.nimble\pkgs\gintro-0.4.7\gintro\gimpl.nim(88, 114) Warning: l: NimNode -> NimNode` instead; getImpl is deprecated [Deprecated]

I'll leave it for you to close this issue.

@StefanSalewski
Copy link
Owner

Thanks for reporting.

Yesterday Araq told me that I have to make a few global variables which are used in gintro macros compileTime to fix the issue with latest devel compiler, then it should work again.

The "getImpl is deprecated" is interesting, have not seen it before, will try to fix that also.

The messages after "Remaining delayed methods: 0" seems to indicate that you have not installed GtkSourceView and Vte Packages/DLL on your box. That is OK, you may indeed not need them, and they are skipped gracefully. (I have to check the messages, there seems to be typos :-( ) If you have some basic knowledge of Windows, you may investigate if and how you can install these two missing packages, so I can add that info to the doc page for other windows users.

@msrn1975
Copy link

msrn1975 commented Nov 8, 2022

Hi,

I got this error, same error with this issue.
Hint: gc: refc; opt: none (DEBUG BUILD,-d:release` generates faster code)
69987 lines; 2.290s; 116.887MiB peakmem; proj: C:\Users\masri\AppData\Local\Temp\gintrosalewski\gen.nim; out: C:\Users\masri\AppData\Local\Temp\gintrosalewski\gen.exe [SuccessX]
could not load: libgirepository-1.0-1.dll
stack trace: (most recent call last)
C:\Users\masri\AppData\Local\Temp\nimblecache-0\nimscriptapi_1408302338.nim(199, 29)
C:\Users\masri\AppData\Local\Temp\nimble_6160\githubcom_stefansalewskigintro\gintro.nimble(77, 7) installBefore
C:\Users\masri\AppData\Local\Temp\nimble_6160\githubcom_stefansalewskigintro\gintro.nimble(64, 7) prep
C:\programming\nim-1.6.8\lib\system\nimscript.nim(273, 7) exec
C:\programming\nim-1.6.8\lib\system\nimscript.nim(273, 7) Error: unhandled exception: FAILED: C:\Users\masri\AppData\Local\Temp\gintrosalewski\gen 1 [OSError]
Warning: Couldn't remove Nimble's temp dir
Error: Exception raised during nimble script execution

`

and I checked gir.nim and it have libgirepository-1.0-1.dll

is this same issue?

@msrn1975
Copy link

msrn1975 commented Nov 8, 2022

sorry, managed to solved it with this
pacman -S mingw-w64-x86_64-python3-gobject
the file is in this package.

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