[CM] nrepl build error

Brad Christensen bchristensen-lists at outlook.com
Mon Sep 20 13:19:02 PDT 2021


Greetings,

The following build command I had taken from s7.html's nrepl section no longer works:
gcc -o nrepl s7.c -O2 -I. -Wl,-export-dynamic -lm -ldl -DWITH_MAIN -DWITH_NOTCURSES -lnotcurses-core

Luckily, the alternative given just below it does:
gcc -c s7.c -O2 -I. -Wl,-export-dynamic -lm -ldl
gcc -o nrepl nrepl.c s7.o -lnotcurses-core -lm -I. -ldl

It seems the issue revolves around the `WITH_MAIN` and `S7_MAIN` defines. The relevant code:
``` s7.c
94951 #if WITH_MAIN && WITH_NOTCURSES
94952   #define S7_MAIN 1
94953   #include "nrepl.c"
94954   /* gcc -o nrepl s7.c -O2 -I. -Wl,-export-dynamic -lm -ldl -DWITH_MAIN -DWITH_NOTCURSES -lnotcurses-core */
94955 #else
```

``` notcurses_s7.c:
41 #if (!S7_MAIN)
42 static s7_int s7_integer_checked(s7_scheme *sc, s7_pointer val)
43 {
44   if (!s7_is_integer(val))
45     s7_wrong_type_arg_error(sc, __func__, 0, val, "an integer");
46   return(s7_integer(val));
47 }
48 #endif
```

Perhaps a remnant of work-in-progress code?

Cheers, Brad


More information about the Cmdist mailing list