|
From: Mark E. <ma...@eg...> - 2003-05-19 18:24:00
|
Greg Chicares wrote: > Mark Eggenstein wrote: >>Is it possible to name your main-procedure other than main() ? > You'd have to download the startup code and hack it. uh oh. That's not what I intend to. >>I can't have a main() (clashes >>with other main()s in other files). > There can be only one main(). Execution has to begin > at exactly one point. I know. Therefore I thought it would be possible to name them all differently and tell the linker which one is the real start. > Pick the one main() you really want to call at startup. > Rename the others and have the real main() call them. Ok, I think I have to explain the underlying problem: Every source file (one class = one file) has a self-running unit test, hence a main(). In addition to testing each unit on its own, a testprogram should test them all. So the main test and each unit-test has a main. By naming them all differently like testmain() stringtestmain() etc. I would have to compile the .o's only once and create different executables while indicating with is the wanted main. Hm, understandable? Anyway, it seems like there's no way around because of some initializations in other parts of the library. Thanks anyway. mic |