This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: main in namespace
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Hilfe <meine dot hilfe at googlemail dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 14 Aug 2008 07:24:22 -0500
- Subject: Re: main in namespace
Hi Hilfe,
> I use a gcc 2.95.3 and if i but the main function in a namespace the
> compiler doesn't found the it.
The main-in-a-namespace is not the global main() that the compiler is
looking for.
You could try to declare your main-in-a-namespace as:
extern "C" int main();
> Is there fix for this problem?
Yes. Don't put main in a namespace.
HTH,
--Eljay