This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Static Initializer
- From: Mike Stump <mrs at apple dot com>
- To: Kartchner Val Civ OO-ALC/MASHA <Val dot Kartchner at HILL dot af dot mil>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>, "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 18 Oct 2004 12:36:28 -0700
- Subject: Re: Static Initializer
- References: <28D2D04B2E962F4CA8EB97827626487236B571@fskrsm42.hill.af.mil>
On Oct 18, 2004, at 8:49 AM, Kartchner Val Civ OO-ALC/MASHA wrote:
We are using the Verdix Ada compiler and GNU C++ compiler to create an
executable. Each language wants to have it's "main" procedure run so
that
it can control startup and initialize static and global variables. But
there can be only one main. I'm hoping that there is a global
function that
I can call to initialize the C++ static and globals. I have checked
the FAQ
and the manuals, but I haven't found an answer to my question.
Compile an empty main on your system, and then see what it does, then,
put that code in your code to initialize C++; or, use symbol remapping
features of your linker to change the name main of the C++ main.o file,
to cpp_main, and then in Ada, call cpp_main when you want; or, recode
gcc's initialization strategy for your platform to not be so brain dead
and join the 1980s.
The last one main in fact be the nicest long term solution... :-)