[comp.sys.mac.programmer] undefined __MAIN

scotth@rocco.labs.tek.com (Scott Herzinger) (02/16/91)

This question was answered some time ago; at the time it wasn't relevant
to me, now it's biting me.

I've just gotten back into a MacApp/C++ project. MABuild has started
to terminate due to a linker error, complaining that I haven't provided
an entry point and that __MAIN isn't defined. This started after I first
used MPW Shell 3.2b8 and the interfaces on the System 6.0 beta CD. But
the problem doesn't go away when I switch back to MPW 3.1.

I've been off this project for several weeks and I'm rusty on some parts
of the build process. The code hasn't changed and everything used to work
just fine.

Any clues as to what I've broken?

Scott Herzinger   scotth%crl.labs.tek.com@relay.cs.net
                  Computer Research Lab, Tektronix, Inc.
                  PO Box 500 MS 50-662, Beaverton, OR 97077

andrew@jhereg.osa.com (Andrew C. Esh) (02/18/91)

In article <SCOTTH.91Feb15140128@rocco.labs.tek.com> scotth@rocco.labs.tek.com (Scott Herzinger) writes:
...
>
>I've just gotten back into a MacApp/C++ project. MABuild has started
>to terminate due to a linker error, complaining that I haven't provided
>an entry point and that __MAIN isn't defined. This started after I first
>used MPW Shell 3.2b8 and the interfaces on the System 6.0 beta CD. But
>the problem doesn't go away when I switch back to MPW 3.1.
>
...
>
>Any clues as to what I've broken?
>
>Scott Herzinger   scotth%crl.labs.tek.com@relay.cs.net
>                  Computer Research Lab, Tektronix, Inc.
>                  PO Box 500 MS 50-662, Beaverton, OR 97077

I ran into this problem about a year ago. It had to do with an interaction
between the C++ compiler, and the MPW Linker. I don't happen to remember
the exact cause, but I do remember that you can see it happen very plainly
if you turn on all the Symbol table dumping in the Linker and the
compiler. The symbol table entry for "main" is being overwritten. As I
remember it, I either did some massive rearrangement of the amount of
memory allocated for MPW under Multifinder, and within MPW I changed the
amont of stack space, and such. I also turned off some of the symbol file
preloading. I may also have backed up to the previous version of the
compiler, or linker. Sorry I can't be more specific, but it was a year ago,
and there were so many problems going on at the time that we were
reconfiguring the entire development environment on a daily basis. 
-- 
Andrew C. Esh
Open Systems Architects, Inc.
(612)525-0000
andrew@osa.com		previously: andrew!drum!gong!bangyerdead

dhoyt@vx.acs.umn.edu (DAVID HOYT) (02/22/91)

>In article <SCOTTH.91Feb15140128@rocco.labs.tek.com> scotth@rocco.labs.tek.com (Scott Herzinger) writes:
>I've just gotten back into a MacApp/C++ project. MABuild has started
>to terminate due to a linker error, complaining that I haven't provided
>an entry point and that __MAIN isn't defined. This started after I first
>used MPW Shell 3.2b8 and the interfaces on the System 6.0 beta CD. But
>the problem doesn't go away when I switch back to MPW 3.1.

  I have seen this problem when -AutoBuild has been choosen.  My workaround
is to MABuild -AutoBuild to compile all of the Pascal stuff, then use
-NoAutoBuild to compile (and/or link) the application.

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