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 g_error_free on Windows 11 #56

Open
bigos opened this issue Dec 7, 2023 · 6 comments
Open

Error g_error_free on Windows 11 #56

bigos opened this issue Dec 7, 2023 · 6 comments

Comments

@bigos
Copy link

bigos commented Dec 7, 2023

While trying to run your library on Windows 11 I got this error. I have installed Msys2 and pulled the Gtk libraries this way and added the dlls of thos libraries to the Windows PATH. Does anybody have idea how to solve it?

#CL-USER> (ql:quickload :clos-sweeper)
To load "clos-sweeper":
  Load 1 ASDF system:
    clos-sweeper
; Loading "clos-sweeper"
..................................................
[package gtk4]

; file: C:/Users/jacek/quicklisp/dists/ultralisp/software/bohonghuang-cl-gtk4-20231117132140/gtk4.lisp
; in: GOBJECT-INTROSPECTION-WRAPPER:DEFINE-GIR-NAMESPACE "Gtk"
;     (GOBJECT-INTROSPECTION-WRAPPER:DEFINE-GIR-NAMESPACE "Gtk" "4.0")
; 
; caught ERROR:
;   (during macroexpansion of (GOBJECT-INTROSPECTION-WRAPPER:DEFINE-GIR-NAMESPACE "Gtk" ...))
;   The alien function "g_error_free" is undefined.
@bigos
Copy link
Author

bigos commented Dec 7, 2023

Correction, installing that way allows me to compile the project. I guess I accidentally installed mingw-w64-ucrt-x86_64-gtk4. They are not the same.

pacman -S mingw-w64-x86_64-gtk4 mingw-w64-x86_64-cairo mingw-w64-x86_64-gobject-introspection

@bigos
Copy link
Author

bigos commented Dec 8, 2023

I have a little project: https://github.com/bigos/clos-sweeper

In the README file, I explain various problems I had with making my little game run on Windows. I managed to solve the problem, but I do not know the recommended setup for running SBCL on Windows and using GTK4 and related libraries. Developing on Linux is so much easier.

@bohonghuang
Copy link
Owner

In the README file, I explain various problems I had with making my little game run on Windows. I managed to solve the problem, but I do not know the recommended setup for running SBCL on Windows and using GTK4 and related libraries. Developing on Linux is so much easier.

It seems like you haven't mentioned any errors related to running on Windows in the README. In fact, Windows has not been the preferred platform for GTK because it is not UNIX, and configuring the development and runtime environments can be more complicated, as described in your README. Based on my experience, if your application runs well on Linux but encounters issues on Windows, it is likely a problem with GTK itself.

@bigos
Copy link
Author

bigos commented Dec 9, 2023

Or the environment variables...

Maybe, one day, someone will provide more information.

Thank you for the great library.

@bigos
Copy link
Author

bigos commented Dec 9, 2023

https://stdin.top/posts/gtk4-on-windows/

Could that be the information I need? I will try tomorrow.

@bohonghuang
Copy link
Owner

https://stdin.top/posts/gtk4-on-windows/

Could that be the information I need? I will try tomorrow.

I believe packages like pkg-config mentioned in this article are not necessary for Lisp. All you need to do is install gtk4, gobject-introspection, and other relevant packages in MSYS2. Then, add the bin directory of mingw64 to the environment variables and run SBCL with this environment variable. This should be enough for cffi:load-foreign-library to locate the required dynamic libraries. Personally, I strongly recommend downloading the source code of SBCL on Windows, enabling the option for core compression, and compiling SBCL in the MSYS2 environment. This is because uncompressed SBCL executable files can be very large, which is not ideal for distribution.

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

2 participants