Re: Calling Lisp from C (SBCL as a shared object)
"Sage Imel" <[email protected]> Sat, 18 Jan 2025 21:02:51 -0800
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <[email protected]> |
Hello Gareth,
I think you just need to add -rdynamic to your gcc command
Sage Imel
On Fri, Jan 17, 2025, at 7:55 PM, J. Gareth Williams wrote:
> Hi,
>
> I have been struggling to get even a trivial example of DEFINE-ALIEN-CALLABLE to work, and was wondering if anyone could take a look at what I might be doing wrong.
>
> Full source:
> git clone https://gitlab.com/garethw14/simple-sbcl-alien-callable.git
>
> It compiles okay and links, but on initialize_lisp(), I land in the debugger:
>
> ---
> In main, about to initialize_lisp()
>
> debugger invoked on a SB-KERNEL::UNDEFINED-ALIEN-VARIABLE-ERROR in thread
> #<THREAD "main thread" RUNNING {10013A8003}>:
> * Attempt to access an undefined alien variable.
*
> Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
>
> restarts (invokable by number or by possibly-abbreviated name):
> 0: [ABORT] Exit from the current thread.
>
> ("foreign function: call_into_lisp_")
> 0]
> ---
>
> I've tried some other examples I've found around the web, but they seem to yield the same result.
>
> Tested on Debian 12.9, SBCL versions 2.5.0 and 2.3.2
>
> Would appreciate any insight!
>
> gareth
>
>
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>
_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help