delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/14/14:15:54

From: Paul Hughett <hughett AT mercur DOT uphs DOT upenn DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: pass C source to program binary?
Date: 14 Sep 2000 18:00:46 GMT
Organization: University of Pennsylvania
Lines: 16
Message-ID: <8pr3oe$niu$1@netnews.upenn.edu>
References: <200009141606 DOT LAA19381 AT darwin DOT sfbr DOT org>
NNTP-Posting-Host: node.uphs.upenn.edu
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3smp (i686))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019