[comp.sys.mac.programmer] Problems with MPW Link & MacApp

mkb@rover.ri.cmu.edu (Mike Blackwell) (10/30/90)

I'm writing a medium sized application using MPW 3.1, MacApp 2.0 and C++
3.1b1. Mac-II with 8M, system 6.0.7. Starting this afternoon, with the
addition of just a few more methods, my application has stopped linking
correctly, and falls out of MABuild with the following error:

### Link: Error: Main code (-m option) name not found. (Error 53) %__MAIN
### Link: Error: No Main code module or entry point. (Error 38) 
### Link: Errors prevented normal completion.

Of course there is a perfectly good main() in my program. The strange part
is that this only occurs when I'm running under Multifinder. If I run MPW
from Unifinder and it has all 8M available, it links just fine (by just
running MABuild again - not even any recompiling). I have MPW set with a 3M
partition (C++ needed it), and MABuild seems to use the -mf flag for link so
it can get additional Multifinder memory, and Finder tells me I have at
least a 2.7M block free. That would certainly seem to be enough memory...
And we're still in the small application stage here. I tried giving MPW a 4M
partition, but with the same results.

Additional information: I'm building a debug version, and my code is
segmented up in to a couple of nice bite sized chunks.

Any ideas what the problem might be?

		Mike Blackwell		mkb@rover.ri.cmu.edu

dhoyt@vx.acs.umn.edu (10/30/90)

In article <10909@pt.cs.cmu.edu>, mkb@rover.ri.cmu.edu (Mike Blackwell) writes...
>### Link: Error: Main code (-m option) name not found. (Error 53) %__MAIN
>### Link: Error: No Main code module or entry point. (Error 38) 
>### Link: Errors prevented normal completion.

  I find this to happen whenever I use -AutoBuild.  When I want to recompile
an new system, I use -AutoBuild to compile all of the MacApp code, then
use -NoAutoBuild to compile my code.  This seems to work most of the time.

  As I side note, I have been having illegal instruction errors from a
subroutine called by cplusinit (or whatever) causing the program to terminate
before main() is ever called.  I have a const char[], but no initialized global
statics, no stream i/o, really nothing that I can see that would make the
initializer call anything differently for this program than other (working)
applications.  I am using 2.0b9 of MacApp and the beta version of c++.

  When I do get the program to call main() (I haven't figured out how I manage
this yet) it will blow up from MacApp (after TApp->run()) while trying to
unload all segments (including Main).  MacApp then kindly warns me that
unloading a segment that I'll return to is a Bad Idea.  Clues?

david | dhoyt@vx.acs.umn.edu | dhoyt@umnacvx.bitnet