This is the mail archive of the gcc-help@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: 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


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