crategus / cl-cffi-gtk

cl-cffi-gtk is a Lisp binding to the GTK+ 3 library.
http://www.crategus.com/books/cl-cffi-gtk
146 stars 33 forks source link

SBCL STYLE-WARNING: Undefined alien #38

Open ralph-schleicher opened 8 years ago

ralph-schleicher commented 8 years ago

Hi Dieter, if you create an image in SBCL, e.g. via

 (ql:quickload "CL-CFFI-GTK")
 (sb-ext:save-lisp-and-die "cl-cffi-gtk.core")

and run SBCL with that image, e.g.

 sbcl --core cl-cffi-gtk.core

then you get hundreds of warnings of the form

 STYLE-WARNING: Undefined alien: "gtk_get_major_version"
 STYLE-WARNING: Undefined alien: "gtk_get_minor_version"
 STYLE-WARNING: Undefined alien: "gtk_get_micro_version"

because the dynamic libraries are loaded twice. See here for more details. Short summary:

 Nikodemus Siivola wrote:
 > 
 > On 19 October 2010 16:54, Teemu Likonen <tlikonen@...> wrote:
 > 
 > > It seems that I don't even have to load libraries every time when
 > > loading an SBCL image. Just load foreign libraries once in the
 > > image-creation session. The saved SBCL image will load foreign
 > > libraries automatically when it's started. This was a bit unexpected
 > 
 > If you load a foreign libraries and then save a core, then the same
 > set of libraries will be loaded on startup -- the assumption is that
 > they were there for a reason.

Here is a patch for cl-cffi-gtk. It checks whether or not a dynamic library is already loaded before calling use-foreign-library. It also fixes a typo in gio.init.lisp (use of glib instead of gio):

cl-cffi-gtk.diff.txt

Thanks, Ralph

Ferada commented 8 years ago

@ralph-schleicher I took the diff and created a PR here, however I'll close it if you'd like to create your own instead.

ralph-schleicher commented 8 years ago

That's fine for me. Thanks.

ryukinix commented 7 years ago

I have the same problem. Any news about that issue?

Ferada commented 7 years ago

@ryukinix take a look at https://github.com/Ferada/cl-cffi-gtk/tree/fixes - I'm maintaining ongoing fixes and am also trying to revive this / take over maintainership, but that's a slow process. If you'd like to discuss things more easily maybe come by on Freenode on the #cl-cffi-gtk channel.

ralph-schleicher commented 7 years ago

@Ferada is right. For the moment you have to fork cl-cffi-gtk and merge patches from other forks as you please.

ryukinix commented 7 years ago

Thanks for the advise! Great lib and good docs, btw.