Warning: 1436 running example code

8 views
Skip to first unread message

Leigh Gable

unread,
Jul 2, 2025, 12:16:26 AMJul 2
to chibi-scheme
Hello! 

Any pointers would be much appreciated. I am trying out Chibi on my ancient little laptop running NixOS. I'm starting with the example code from the "Embedding in C" quickstart, but my little display snippet in a scheme file doesn't output anything, and when I step through it in gdb I see a "sexp.c: No such file or directory" warning. I've tried an absolute path, a relative path, but no joy. I'm compiling with "gcc -Wall hello.c -o hello -l chibi-scheme".  The hello.ss file just contains (import (chibi)) (display "Hello World!")(newline)

The example code from here:

#define SEXP_USE_GREEN_THREADS 0 #include <stdio.h> #include <chibi/eval.h> void dostuff(sexp ctx) { /* declare and preserve local variables */ sexp_gc_var1(obj1); sexp_gc_preserve1(ctx, obj1); /* load a file containing Scheme code */ obj1 = sexp_c_string(ctx, "hello.ss", -1); sexp_debug(ctx, "Obj1: ", obj1); sexp_load(ctx, obj1, NULL); sexp_eval_string(ctx, "(display \"this is a test.\")", -1, NULL); /* release the local variables */ sexp_gc_release2(ctx); } int main(int argc, char** argv) { sexp ctx; sexp_scheme_init(); ctx = sexp_make_eval_context(NULL, NULL, NULL, 0, 0); sexp_load_standard_env(ctx, NULL, SEXP_SEVEN); sexp_load_standard_ports(ctx, NULL, stdin, stdout, stderr, 1); dostuff(ctx); sexp_destroy_context(ctx); }

Alex Shinn

unread,
Jul 2, 2025, 12:25:47 AMJul 2
to chibi-...@googlegroups.com
Hi!

That exact example works for me.  Either using gdb or printf debugging you should track down which file it can't find.

Note in addition to the file you're explicitly trying to load, the standard env will be implicitly loaded from wherever you installed it.

-- 
Alex

--
You received this message because you are subscribed to the Google Groups "chibi-scheme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chibi-scheme...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/chibi-scheme/bdb6a737-27da-4861-8ca8-c96b3d4c053an%40googlegroups.com.

Leigh Gable

unread,
Jul 4, 2025, 1:03:48 PMJul 4
to chibi-scheme
Thanks for the reply!

I should have guessed it was a Nix thing. If any chibi nix neophytes like myself look at this, the nix package was not passing the right path while building the package. It's being fixed right now in nixpkgs with this PR. I was able to get it working by adding the following to my flake.nix file:
```
pkgs = import nixpkgs { inherit system; overlays = [ (final: prev: { chibi = prev.chibi.overrideAttrs { makeFlags = ["PREFIX=$(out)"]; }; }) ]; };
```
Reply all
Reply to author
Forward
0 new messages