This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Static Initializer


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... :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]