[comp.sys.mac.programmer] A library of compile class functions?

sbchanin@ai.mit.edu (Steve Chanin) (11/23/90)

I've just started playing with the Think C class libraries and it
seems like a waste to add all the Cxxx.c files to a project because 1)
the project gets huge, and 2) it takes forever to compile.  I was
wondering if it would be possible to make a project with all the
Cxxx.c files, compile it, and save it.  Then anything else I wrote
could simply add it like MacTraps and the linker would make sure that
my application only got the code it needed.  Is there a complication
that I'm missing?

Thanks,
Steve

P.S. - I understand that loading a library the size of one containing
all the Cxxx.c files would take a while, but I'm sure that it would be
faster than recompling everything all the time.  And since you could
then feasible remove objects before saving, projects would be much
smaller.
--
===============================================================================
DOMAIN: sbchanin@ai.mit.edu
USMAIL: Steven Chanin, 1010 Mass Ave #57, Cambridge, Ma 02138
PHONE : (617) 876-1950

rsfinn@athena.mit.edu (Russell S. Finn) (11/25/90)

In article <SBCHANIN.90Nov22222153@rice-chex.ai.mit.edu> sbchanin@ai.mit.edu (Steve Chanin) writes:

   I've just started playing with the Think C class libraries and it
   seems like a waste to add all the Cxxx.c files to a project because 1)
   the project gets huge, and 2) it takes forever to compile.  I was
   wondering if it would be possible to make a project with all the
   Cxxx.c files, compile it, and save it.  Then anything else I wrote
   could simply add it like MacTraps and the linker would make sure that
   my application only got the code it needed.  Is there a complication
   that I'm missing?

Yes, namely the fact that projects and libraries can't contain more
than 32K of code, which TCL does.  The suggested solution to your
problem is to create a project containing TCL only, and compile it
once; when you start a new project, make a copy of that project and
use it as a starter.

-- Russell S. Finn
rsfinn@{athena,lcs}.mit.edu

d88-jwa@byse.nada.kth.se (Jon W{tte) (11/25/90)

In article <RSFINN.90Nov24181333@e40-008-11.mit.edu> rsfinn@athena.mit.edu (Russell S. Finn) writes:
>Yes, namely the fact that projects and libraries can't contain more
>than 32K of code, which TCL does.  The suggested solution to your
>problem is to create a project containing TCL only, and compile it
>once; when you start a new project, make a copy of that project and
>use it as a starter.

This will, of course, waste disk space for the poor sod who asked in
the first place...

You can split the project in two segments (as is done in the Starter
project) and use two projects (Starter1 and Starter2) but that seems
a little kludgy .-/

Maybe when Symantec has fixed background compilation and the possibility
to recover from errors and continue syntax-checking, they will allow
multi-segment projects to be added ?

								h+

h+@nada.kth.se
"Moof!(tm)"

nick@cs.edinburgh.ac.uk (Nick Rothwell) (11/26/90)

In article <RSFINN.90Nov24181333@e40-008-11.mit.edu>, rsfinn@athena.mit.edu (Russell S. Finn) writes:
> In article <SBCHANIN.90Nov22222153@rice-chex.ai.mit.edu> sbchanin@ai.mit.edu (Steve Chanin) writes:
> Yes, namely the fact that projects and libraries can't contain more
> than 32K of code, which TCL does.  The suggested solution to your
> problem is to create a project containing TCL only, and compile it
> once; when you start a new project, make a copy of that project and
> use it as a starter.

Er... My application project includes three TCL projects (called Core 1,
Core 2 and More). There's also a project with TBUtilities + MacTraps +
other bits and pieces. These TCL projects are shared between all my TCL
applications (well, currently only one...!).

The secret is to have two Core Classes projects (A-M and N-Z perhaps) -
a single one would be too big, as you say.

Doing it your way (if I understand it correctly) has two big disadvantages:
(1) recompiling everything is expensive, and (ii) global find/replace
searches go through the TCL sources as well.

-- 
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcsun!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
 "You ain't seen nothing yet. I can take this floor out too, no trouble."