[Ecls-list] Compile Flags

Mark McCurry mark.d.mccurry at gmail.com
Wed Jul 27 22:50:27 UTC 2011

> No. The generated files are not for you to use.
Ok, thanks for clarifying that.

> Embedding of ECL in C programs has been discussed at length here and at the
> ECL wiki.
Well, I had no luck digging through the mailing list and the wiki is vague.
I have managed to get the linking working after playing around for a bit.
The process I used to link the static lisp code "F-NAME.lisp" was:

1) Run ecl script to:
(compile-file F-NAME.lisp :system-p t)
(c:build-static-library F-NAME :lisp-files '(F-NAME.o))

2) In C file to be linked:
cl_boot(argc, argv);
void init_lib_F_NAME(cl_object);
read_VV(OBJNULL, init_lib_F_NAME);

3) Compile C with static library

Is this the 'right' way to embed a static piece of lisp code into a C program?
If so, I will toss up the information onto the wiki.
Otherwise: am I missing something painfully obvious?

--Mark McCurry

More information about the ecl-devel mailing list