help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing entry point function


From: Premk
Subject: Re: Changing entry point function
Date: Thu, 09 Aug 2007 21:41:19 -0000
User-agent: G2/1.0

We have a set of test modules which are derived from a specific base
class . All the .cpp files have their own main functions.
I'm writing a small module to automate all these classes.
I just want to implement it in a way that affects the existing modules
to the least.

I wanted the new main(from my class) function to be called when the
automation is executed ..
I got away of the different main functions by using the --allow-
multiple-definitions flag of the linker.

I understand the design of the other classes can be changed to achieve
this, but the org wont allow this.




On Aug 8, 10:24 pm, jg <jgu...@gmail.com> wrote:
> > g++ -Wl,-emymain__Fv  a.o
>
> > Now the linker says:
> > /usr/lib/crt1.o(.text+0x18): Infunction`_start':
> > : undefined reference to `main'
> > collect2: ld returned 1 exit status
>
> You may provide a dummy main and try the above again.
> Why do you want to use differententryrather than main ?
> Just curious.
>
> JG




reply via email to

[Prev in Thread] Current Thread [Next in Thread]