[prog] Re: C++

Kathryn Hogg kjh at flyballdogs.com
Mon Mar 15 09:59:33 EST 2004


Sue Stones said:
> On Mon, 15 Mar 2004 12:03 pm, wolf wrote:
>> well it now compiles but returns this error:
>> Compiling...
>> ld: Undefined symbols:
>> _main
>
> You need to define main as classname::main() - just as you do with the
> other
> functions.


Sorry, but that is categorically incorrect.  The canonical form of main is

int main(int argc, char **argv)

I suspect the reason that main was undefined is because it was declared
inside of a '#ifdef'.  I'm not sure what the purpose of this ifdef is
supposed to be, but it certainly could easily prevent the whole block of
code inside of it from being compiled.

-- 
Kathryn
http://womensfootyusa.com


More information about the Programming mailing list