This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Global object initialisation doesn't work ??
- From: kavii ita <systemonchip2000 at yahoo dot co dot in>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 5 Nov 2004 07:13:31 +0000 (GMT)
- Subject: Global object initialisation doesn't work ??
Hello,
My g++ compiler doesn't generate the .ctor and dtor
sections.
So the global obects in the code doesn't work.
The following test case works.
When I see the objdump/readelf of the hello.c, it
shows the
/ctor section coming empty.
how do put the [cd]tor section content in to the code
?
I am using 3.3. compiler.
I came to know that crtbegin, crtend ojects are needed
to be linked for c++. Is this right?
==============================================
hello.c
================================
#include <stdio.h>
int main ()
{
class A {
public:
A ()
{
printf ("Public hello ! ");
}
};
A a;
}
================================
But this test case doesn't work.
================================
#include <stdio.h>
class A
{
public:
A ()
{
printf ("Public hello ! ");
}
};
A a;
int main ()
{
}
================================
-kavii
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony