This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Namespaces & main()
- To: EGCS List <egcs at cygnus dot com>
- Subject: Namespaces & main()
- From: Gerald Gutierrez <gutier at intergate dot bc dot ca>
- Date: Sat, 10 Oct 1998 18:34:20 -0700
Hi all. I'm not very familiar with C++ namespaces yet so perhaps the
following may be correct behaviour. If so, please let me know.
If I try compiling the following :
namespace A { void main () { } }
namespace B { void main () { } }
egcs 1.1b gives me the following :
/tmp/ccNoTIxu.s: Assembler messages:
/tmp/ccNoTIxu.s:27: Fatal error: Symbol main already defined.
but if I renamed them to something else, like fmain(), then the code
compiles fine.
Alternatively, if I have the following :
namespace C {
void main () { }
namespace D {
void main () { }
}
}
I get :
/tmp/cc84q10E.s: Assembler messages:
/tmp/cc84q10E.s:27: Fatal error: Symbol main already defined.
as well. If I rename them to something else, the code compiles fine.
Is this correct C++ behaviour or is this something wrong with egcs ?