[Ecls-list] defining callbacks in multiple lisp files does not work
Klaus Falb
klaus.falb at aon.at
Thu Feb 23 13:30:01 UTC 2006
I am using the CVS version of ECL and found a bug:
I have a few lisp files which are compiled into a single executable. In
two files I define callbacks with FFI:DEFCALLBACK. When compiling, the
linker dies with the error "multiple definition of `ecl_callback_0'".
After trying a few things I found out that the number after
"ecl_callback" is incremented seperately for each file, but the
functions are defined globally, so we have a name conflict. This can
probably be fixed by declaring the callback functions static.
You can see the bug with this code:
a.lisp:
(ffi:defcallback foo :void () nil)
b.lisp:
(ffi:defcallback bar :void () nil)
>(compile-file "a.lisp" :system-p t)
>(compile-file "b.lisp" :system-p t)
>(c:build-program "foo" :lisp-files '("a.o" "b.o"))
More information about the ecl-devel
mailing list