Mail Archives: djgpp/2000/09/14/14:15:54
Jeff Williams <jeffw AT darwin DOT sfbr DOT org> wrote:
: Is there a obvious technique for passing the source code for a small C
: function (e.g., `for (i=1;i<=N;i++) y[i]=foo(x[i]);'), which might be in
: a file or passed via command-line, to an already-compiled C program and
: have that program be able to interpret and use the function internally?
: I'm looking for a way to give a program some extra flexibility
: without requiring the user to write various custom C functions and
: then re-compile/re-link with the main program.
Compile the small C code into a shared library (Unix) or DLL (Windows)
and have the main code dynamically link to it. If you're clever enough,
the main code could do all this invisibly to the user (at least under
the Unix systems that I know; I can't speak for Windows).
Paul Hughett
- Raw text -